<commit_before><?php
/**
 * @copyright   2015 <NAME>, Caelaris
 * @license     MIT
 * @author      <NAME> (<EMAIL>)
 */

if (!class_exists('Caelaris_Toolkit')) {
    Caelaris_Autoloader::register();
}

/**
 * Class Caelaris_Autoloader
 */
class Caelaris_Autoloader
{
    /**
     * Registered flag
     *
     * @var boolean
     */
    protected static $registered = false;

    /**
     * Library directory
     *
     * @var string
     */
    protected static $libDir;

    /**
     * Register the autoloader in the spl autoloader
     *
     * @return void
     * @throws Exception If there was an error in registration
     */
    public static function register(){
        if( self::$registered ){
            return;
        }

        self::$libDir = dirname(__FILE__);

        if(false === spl_autoload_register(array('Caelaris_Autoloader', 'loadClass'))){
            throw new Exception('ERROR: Unable to register Caelaris_Autoloader::loadClass as an autoloading method.');
        }

        self::$registered = true;
    }

    /**
     * Unregisters the autoloader
     *
     * @return void
     */
    public static function unregister(){
        spl_autoload_unregister(array('Caelaris_Autoloader', 'loadClass'));
        self::$registered = false;
    }

    /**
     * Loads the class
     *
     * @param string $className The class to load
     *
     * @return bool|void
     * @throws Exception
     */
    public static function loadClass($className)
    {
        // handle only package classes
        if(strpos($className, 'Caelaris_') !== 0){
            return;
        }

        $className = substr($className,9);
        $fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

        if(file_exists($fileName)){
            require $fileName;
            return true;
        } else {
            throw new Exception('cannot load class: ' . $className);
        }
    }
}<commit_msg>Removed exception and return value from autoloader to comply with PSR-4<commit_after><?php
/**
 * @copyright   2015 <NAME>, Caelaris
 * @license     MIT
 * @author      <NAME> (<EMAIL>)
 */

if (!class_exists('Caelaris_Toolkit')) {
    Caelaris_Autoloader::register();
}

/**
 * Class Caelaris_Autoloader
 */
class Caelaris_Autoloader
{
    /**
     * Registered flag
     *
     * @var boolean
     */
    protected static $registered = false;

    /**
     * Library directory
     *
     * @var string
     */
    protected static $libDir;

    /**
     * Register the autoloader in the spl autoloader
     *
     * @return void
     * @throws Exception If there was an error in registration
     */
    public static function register(){
        if( self::$registered ){
            return;
        }

        self::$libDir = dirname(__FILE__);

        if(false === spl_autoload_register(array('Caelaris_Autoloader', 'loadClass'))){
            throw new Exception('ERROR: Unable to register Caelaris_Autoloader::loadClass as an autoloading method.');
        }

        self::$registered = true;
    }

    /**
     * Unregisters the autoloader
     *
     * @return void
     */
    public static function unregister(){
        spl_autoload_unregister(array('Caelaris_Autoloader', 'loadClass'));
        self::$registered = false;
    }

    /**
     * Loads the class
     *
     * @param string $className The class to load
     *
     * @return bool|void
     * @throws Exception
     */
    public static function loadClass($className)
    {
        /** Handle only toolkit classes */
        if(strpos($className, 'Caelaris_') !== 0){
            return;
        }

        $className = substr($className,9);
        $fileName = self::$libDir . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

        if(file_exists($fileName)){
            require $fileName;
        }
    }
}
{'fraction_non_alphanumeric': 0.12188863228124198, 'fraction_numerical': 0.0033358994098024123, 'mean_word_length': 2.1768541157294212, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '5180515', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1155, 'n_words': 271}