<commit_before><?php

    namespace Maestro;

    if (file_exists(__DIR__.'/../vendor/autoload.php'))
        require_once __DIR__.'/../vendor/autoload.php';

    use Maestro\HTTP\Request;
    use Maestro\Renderer\Renderer;
    use Maestro\Router\Router;
    use Maestro\Utils\HttpCommons;
    use Maestro\Utils\Settings;

    /**
     * Class Maestro
     *
     * PHP MVC's choirmaster.
     *
     * Manages routing, dispatching and middleware injection.
     *
     * @package Maestro
     */
    class Maestro
    {
        /** @var Maestro|null - Singleton */
        static private $_instance = null;

        /** @var Settings - Settings object */
        static protected $_settings = null;

        /** @var array - Class clusters container */
        protected $_containers;
        /** @var Router - Router handling instance */
        protected $_router;
        /** @var array - Routes array */
        protected $_routes;
        /** @var array - Controllers array */
        protected $_controllers;
        /** @var array - Middlewares stack */
        protected $_middlewares;
        /** @var Renderer - Renderer class used to render views */
        protected $_renderer;

        /**
         * CTOR
         */
        public function __construct()
        {
            $this->_router      = new Router();
            $this->_controllers = array();
            $this->_containers  = array();
            $this->_middlewares = array();
            $this->_routes      = array();
        }

        /**
         * Singleton getter
         * @return Maestro
         */
        public static function gi()
        {
            if (self::$_instance === null)
                self::$_instance = new Maestro();

            return self::$_instance;
        }

        /**
         * Settings object automatic instanciation
         */
        private static function __sinst()
        {
            if (self::$_settings === null)
            {
                self::$_settings                         = new Settings();
                self::$_settings['view engine']          = 'php';
                self::$_settings['app path']             = __DIR__ . '/Tests/';
                self::$_settings['env']                  = 'development';
                self::$_settings['controller namespace'] = '\\';
            }
        }

        /**
         * @param $field
         * @return self
         */
        public function enable($field)
        {
            self::__sinst();
            self::$_settings[$field] = true;

            return $this;
        }

        /**
         * @param $field<commit_msg>Maestro/Maestro :: Small code path change<commit_after><?php

    namespace Maestro;

    if (file_exists(__DIR__.'/../vendor/autoload.php'))
        require_once __DIR__.'/../vendor/autoload.php';

    use Maestro\HTTP\Request;
    use Maestro\Renderer\Renderer;
    use Maestro\Router\Router;
    use Maestro\Utils\HttpCommons;
    use Maestro\Utils\Settings;

    /**
     * Class Maestro
     *
     * PHP MVC's choirmaster.
     *
     * Manages routing, dispatching and middleware injection.
     *
     * @package Maestro
     */
    class Maestro
    {
        /** @var Maestro|null - Singleton */
        static private $_instance = null;

        /** @var Settings - Settings object */
        static protected $_settings = null;

        /** @var array - Class clusters container */
        protected $_containers;
        /** @var Router - Router handling instance */
        protected $_router;
        /** @var array - Routes array */
        protected $_routes;
        /** @var array - Controllers array */
        protected $_controllers;
        /** @var array - Middlewares stack */
        protected $_middlewares;
        /** @var Renderer - Renderer class used to render views */
        protected $_renderer;

        /**
         * CTOR
         */
        public function __construct()
        {
            $this->_router      = new Router();
            $this->_controllers = array();
            $this->_containers  = array();
            $this->_middlewares = array();
            $this->_routes      = array();
        }

        /**
         * Singleton getter
         * @return Maestro
         */
        public static function gi()
        {
            if (self::$_instance === null)
                self::$_instance = new Maestro();

            return self::$_instance;
        }

        /**
         * Settings object automatic instanciation
         */
        private static function __sinst()
        {
            if (self::$_settings !== null)
                return;

            self::$_settings                         = new Settings();
            self::$_settings['view engine']          = 'php';
            self::$_settings['app path']             = __DIR__ . '/Tests/';
            self::$_settings['env']                  = 'development';
            self::$_settings['controller namespace'] = '\\';
        }

        /**
         * @param $field
         * @return self
         */
        public function enable($field)
        {
            self::__sinst();
            self::$_settings[$field] = true;

            return $this;
        }

        /**
         * @param $field
{'fraction_non_alphanumeric': 0.1238366571699905, 'fraction_numerical': 0.0, 'mean_word_length': 1.4256103178258868, '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': '6294639', 'n_tokens_mistral': 1361, 'n_tokens_neox': 1349, 'n_words': 322}