<commit_before><?php

namespace MFS\AppServer;

function autoload($class_name)
{
    static $files = null;

    if (null === $files) {
        $root = __DIR__.'/';

        $files = array(
            'MFS\AppServer\iHandler'           => $root.'interfaces.php',
            'MFS\AppServer\iProtocol'          => $root.'interfaces.php',
            'MFS\AppServer\DaemonicHandler'    => $root.'DaemonicHandler.class.php',

            'MFS\AppServer\StringStreamKeeper' => $root.'StringStream.class.php',
            'MFS\AppServer\StringStream'       => $root.'StringStream.class.php',
        );
    }

    if (isset($files[$class_name]))
        require $files[$class_name];
}

spl_autoload_register('MFS\AppServer\autoload');
<commit_msg>exception class, intended for use in middlewares, when applications are not callable<commit_after><?php

namespace MFS\AppServer;

function autoload($class_name)
{
    static $files = null;

    if (null === $files) {
        $root = __DIR__.'/';

        $files = array(
            'MFS\AppServer\iHandler'           => $root.'interfaces.php',
            'MFS\AppServer\iProtocol'          => $root.'interfaces.php',
            'MFS\AppServer\DaemonicHandler'    => $root.'DaemonicHandler.class.php',

            'MFS\AppServer\StringStreamKeeper' => $root.'StringStream.class.php',
            'MFS\AppServer\StringStream'       => $root.'StringStream.class.php',
        );
    }

    if (isset($files[$class_name]))
        require $files[$class_name];
}

// used in middlewares
class InvalidArgumentException extends \InvalidArgumentException {}

spl_autoload_register('MFS\AppServer\autoload');

{'fraction_non_alphanumeric': 0.14754098360655737, 'fraction_numerical': 0.0, 'mean_word_length': 2.621978021978022, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4644508', 'n_tokens_mistral': 524, 'n_tokens_neox': 513, 'n_words': 78}