<commit_before><?php
    namespace Lou117\Core;

    use FastRoute;
    use \Exception;
    use Monolog\Logger;
    use \LogicException;
    use Lou117\Core\Http\Request;
    use Composer\Autoload\ClassLoader;
    use Lou117\Core\Module\ModuleMetadata;
    use Lou117\Core\Module\AbstractModule;
    use Lou117\Core\Service\RoutingProvider;
    use Lou117\Core\Service\LoggerProvider;
    use Monolog\Handler\RotatingFileHandler;
    use Lou117\Core\Service\SettingsProvider;
    use Lou117\Core\Http\Response\TextResponse;
    use Lou117\Core\Http\Response\ProblemResponse;
    use Lou117\Core\Http\Response\AbstractResponse;
    use Lou117\Core\Service\AbstractServiceProvider;

    class Core
    {
        const ROUTES_CACHE_FILEPATH = 'cache/routes';


        /**
         * @var bool
         */
        protected static $booted = false;

        /**
         * @var ClassLoader
         */
        protected static $composerLoader;

        /**
         * HTTP request.
         * @var Request
         */
        protected static $request;

        /**
         * @var array
         */
        protected static $services = [];


        protected function __construct(){}

        protected function __sleep(){}

        protected function __wakeUp(){}

        /**
         * Core main method, to be called by public/index.php.
         * This method has an internal try-catch block, so there is no real need to surround a Core::boot call with
         * another try-catch block.
         * @param array $params - an associative array with two keys:
         * - 'settings': if value is an array, given array will be used as settings; if value is a string, Core will
         * search for a file named as given string, and load this file, expecting an array.
         * - 'composerLoader': an instance of Composer\Autoload\ClassLoader to be used for module registering.
         */
        public static function boot(array $params = [])
        {
            if (self::$booted) {

                throw new LogicException('Core::boot method must not be called twice');

            }

            $params = array_replace([
                "settings" => [],
                "composerLoader" => null
            ], $params);

            self::$composerLoader = $params["composerLoader"];

            $settingsProvider = new SettingsProvider(self::$services);
            self::setService('core.settings', $settingsProvider->set($params));

            try {

                self::setService('core.logger', new LoggerProvider(self::$services));
<commit_msg>Fix a bug when settings was not set correctly into SettingsProvider<commit_after><?php
    namespace Lou117\Core;

    use FastRoute;
    use \Exception;
    use Monolog\Logger;
    use \LogicException;
    use Lou117\Core\Http\Request;
    use Composer\Autoload\ClassLoader;
    use Lou117\Core\Module\ModuleMetadata;
    use Lou117\Core\Module\AbstractModule;
    use Lou117\Core\Service\RoutingProvider;
    use Lou117\Core\Service\LoggerProvider;
    use Monolog\Handler\RotatingFileHandler;
    use Lou117\Core\Service\SettingsProvider;
    use Lou117\Core\Http\Response\TextResponse;
    use Lou117\Core\Http\Response\ProblemResponse;
    use Lou117\Core\Http\Response\AbstractResponse;
    use Lou117\Core\Service\AbstractServiceProvider;

    class Core
    {
        const ROUTES_CACHE_FILEPATH = 'cache/routes';


        /**
         * @var bool
         */
        protected static $booted = false;

        /**
         * @var ClassLoader
         */
        protected static $composerLoader;

        /**
         * HTTP request.
         * @var Request
         */
        protected static $request;

        /**
         * @var array
         */
        protected static $services = [];


        protected function __construct(){}

        protected function __sleep(){}

        protected function __wakeUp(){}

        /**
         * Core main method, to be called by public/index.php.
         * This method has an internal try-catch block, so there is no real need to surround a Core::boot call with
         * another try-catch block.
         * @param array $params - an associative array with two keys:
         * - 'settings': if value is an array, given array will be used as settings; if value is a string, Core will
         * search for a file named as given string, and load this file, expecting an array.
         * - 'composerLoader': an instance of Composer\Autoload\ClassLoader to be used for module registering.
         */
        public static function boot(array $params = [])
        {
            if (self::$booted) {

                throw new LogicException('Core::boot method must not be called twice');

            }

            $params = array_replace([
                "settings" => [],
                "composerLoader" => null
            ], $params);

            self::$composerLoader = $params["composerLoader"];

            $settingsProvider = new SettingsProvider(self::$services);
            self::setService('core.settings', $settingsProvider->set($params["settings"]));

            try {

                self::setService('core.logger', new LoggerProvider(self::$services));

{'fraction_non_alphanumeric': 0.09877017678708686, 'fraction_numerical': 0.012682551883166795, 'mean_word_length': 2.1149012567324954, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1590960', 'n_tokens_mistral': 1407, 'n_tokens_neox': 1324, 'n_words': 390}