<commit_before><?php

/** Zend_Pdf */
require_once 'Zend/Pdf.php';

/**
 * Zend_Pdf_ImageFactory
 *
 * Helps manage the diverse set of supported image file types.
 *
 * @package    Zend_Pdf
 */
class Zend_Pdf_ImageFactory
{
    public static function factory($filename) {
        if(!is_file($filename)) {
            throw new Zend_Pdf_Exception("Cannot create image resource. File not found.");
        }
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        /* 
         * TODO: Use Zend_Mime not file extension. In the mean time, if you need to
         * use an alternate file extension just spin up the right processor directly.
         */
        switch (strtolower($extension)) {
            case 'tif':
                //Fall through to next case;
            case 'tiff':
                return new Zend_Pdf_Image_TIFF($filename);
                break;
            case 'png':
                return new Zend_Pdf_Image_PNG($filename);
                break;
            case 'jpg':
                //Fall through to next case;
            case 'jpe':
                //Fall through to next case;
            case 'jpeg':
                return new Zend_Pdf_Image_JPEG($filename);
                break;
            default:
                throw new Zend_Pdf_Exception("Cannot create image resource. File extension not known or unsupported type.");
                break;
        }
    }
}
?>
<commit_msg>Fixed documentation, moved TODO: to @todo. <commit_after><?php

/** Zend_Pdf */
require_once 'Zend/Pdf.php';

/**
 * Zend_Pdf_ImageFactory
 *
 * Helps manage the diverse set of supported image file types.
 *
 * @package    Zend_Pdf
 * @todo Use Zend_Mime not file extension for type determination.
 */
class Zend_Pdf_ImageFactory
{
    static public function factory($filename) {
        if(!is_file($filename)) {
            throw new Zend_Pdf_Exception("Cannot create image resource. File not found.");
        }
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        /* 
         * There are plans to use Zend_Mime and not file extension. In the mean time, if you need to
         * use an alternate file extension just spin up the right processor directly.
         */
        switch (strtolower($extension)) {
            case 'tif':
                //Fall through to next case;
            case 'tiff':
                return new Zend_Pdf_Image_TIFF($filename);
                break;
            case 'png':
                return new Zend_Pdf_Image_PNG($filename);
                break;
            case 'jpg':
                //Fall through to next case;
            case 'jpe':
                //Fall through to next case;
            case 'jpeg':
                return new Zend_Pdf_Image_JPEG($filename);
                break;
            default:
                throw new Zend_Pdf_Exception("Cannot create image resource. File extension not known or unsupported type.");
                break;
        }
    }
}
?>

{'fraction_non_alphanumeric': 0.0866062437059416, 'fraction_numerical': 0.0, 'mean_word_length': 1.7541589648798521, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4030869', 'n_tokens_mistral': 818, 'n_tokens_neox': 768, 'n_words': 255}