<commit_before><?php
/**
 * @title            Autoloader Class
 * @desc             Loading Framework Class of CMS.
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2012-2013, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Loader
 * @version          1.2
 */

namespace PH7\Framework\Loader;
defined('PH7') or exit('Restricted access');

/**
 * We include the Singleton trait before use, because at this stage the class can not load the trait automatically.
 */
require_once PH7_PATH_FRAMEWORK . 'Pattern/Base.trait.php';
require_once PH7_PATH_FRAMEWORK . 'Pattern/Singleton.trait.php';

final class Autoloader
{

    /**
     * We use this class with the singleton pattern.
     */
    use \PH7\Framework\Pattern\Singleton;

    /**
     * We do not put a "__construct" and "__clone" "private" because it is already included in the class \PH7\Framework\Pattern\Base that is included in the \PH7\Framework\Pattern\Singleton class.
     */

    /**
     * Autoload Classes.
     *
     * @param string $sClass
     * @return void
     */
    private function _loadClass($sClass)
    {
        $sClass = $this->_clean($sClass);

        switch (true)
        {
            /***** To include the libraries *****/

            // To include Classes
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.class.php'):
                $sFile = PH7_PATH_FRAMEWORK . $sClass . '.class.php';
            break;

            // To include Interfaces
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.interface.php'):
                $sFile = PH7_PATH_FRAMEWORK . $sClass . '.interface.php';
            break;

            // To include Traits
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.trait.php'):
                $sFile =  PH7_PATH_FRAMEWORK . $sClass . '.interface.php';
            break;


            /***** To include third-party library that does not have the same naming convention that our CMS *****/

            // To include PFBC library
            case is_file(PH7_PATH_FRAMEWORK . 'Layout/Form/Engine/' . $sClass . '.class.php'):
                $sFile = PH7_PATH_FRAMEWORK . 'Layout/Form/Engine/' . $sClass . '.class.php';
            break;

            // To include SwiftMailer library
            case 0 === stripos($sClass, 'Swift'):
                $sFile = PH7_PATH_FRAMEWORK . 'Mail/Engine/Swift/swift_required.php';
            break;

            default:
                return; // Stop it
        }

        require_once $sFile;
    }

    /**
     * For all classes, hack to remove the namespace, slash and backslash.
     *
     * @param string The class name to clean.
     * @return string The class cleaned.
     */<commit_msg>Removing the case insensitivity because it almost useless<commit_after><?php
/**
 * @title            Autoloader Class
 * @desc             Loading Framework Class of CMS.
 *
 * @author           <NAME> <<EMAIL>>
 * @copyright        (c) 2012-2013, <NAME>. All Rights Reserved.
 * @license          GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package          PH7 / Framework / Loader
 * @version          1.2
 */

namespace PH7\Framework\Loader;
defined('PH7') or exit('Restricted access');

/**
 * We include the Singleton trait before use, because at this stage the class can not load the trait automatically.
 */
require_once PH7_PATH_FRAMEWORK . 'Pattern/Base.trait.php';
require_once PH7_PATH_FRAMEWORK . 'Pattern/Singleton.trait.php';

final class Autoloader
{

    /**
     * We use this class with the singleton pattern.
     */
    use \PH7\Framework\Pattern\Singleton;

    /**
     * We do not put a "__construct" and "__clone" "private" because it is already included in the class \PH7\Framework\Pattern\Base that is included in the \PH7\Framework\Pattern\Singleton class.
     */

    /**
     * Autoload Classes.
     *
     * @param string $sClass
     * @return void
     */
    private function _loadClass($sClass)
    {
        $sClass = $this->_clean($sClass);

        switch (true)
        {
            /***** To include the libraries *****/

            // To include Classes
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.class.php'):
                $sFile = PH7_PATH_FRAMEWORK . $sClass . '.class.php';
            break;

            // To include Interfaces
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.interface.php'):
                $sFile = PH7_PATH_FRAMEWORK . $sClass . '.interface.php';
            break;

            // To include Traits
            case is_file(PH7_PATH_FRAMEWORK . $sClass . '.trait.php'):
                $sFile =  PH7_PATH_FRAMEWORK . $sClass . '.interface.php';
            break;


            /***** To include third-party library that does not have the same naming convention that our CMS *****/

            // To include PFBC library
            case is_file(PH7_PATH_FRAMEWORK . 'Layout/Form/Engine/' . $sClass . '.class.php'):
                $sFile = PH7_PATH_FRAMEWORK . 'Layout/Form/Engine/' . $sClass . '.class.php';
            break;

            // To include SwiftMailer library
            case 0 === strpos($sClass, 'Swift'):
                $sFile = PH7_PATH_FRAMEWORK . 'Mail/Engine/Swift/swift_required.php';
            break;

            default:
                return; // Stop it
        }

        require_once $sFile;
    }

    /**
     * For all classes, hack to remove the namespace, slash and backslash.
     *
     * @param string The class name to clean.
     * @return string The class cleaned.
     */
{'fraction_non_alphanumeric': 0.11292302297036648, 'fraction_numerical': 0.010520778537611783, 'mean_word_length': 1.9161554192229038, 'pattern_counts': {'":': 0, '<': 13, '<?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': '812293', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1605, 'n_words': 473}