<commit_before><?php

namespace Phalex\Mvc;

use Phalcon\Mvc\Application as PhalconApplication;
use Phalex\Mvc\Module;
use Phalex\Config\Config as ConfigHandler;
use Phalex\Di;
use Phalex\Loader\Autoloader;
use Phalex\Events\Listener;

class Application
{
    /**
     *
     * @var Di\DiManager
     */
    protected $diManager;

    public function __construct(array $config)
    {
        $cacheModule   = !isset($config['cache_module']) ? null : $this->getCacheInstance($config['cache_module']);
        $cacheConfig   = !isset($config['cache_config']) ? null : $this->getCacheInstance($config['cache_config']);
        $moduleHandler = new Module($config['modules'], $config['autoload_module_paths'], $cacheModule);
        $entireAppConf = (new ConfigHandler($moduleHandler, $config['config_glob_paths'], $cacheConfig))->getConfig();
        $diFactory     = new Di\Di($entireAppConf);
        $this->diManager = new Di\DiManager($diFactory);
        $diFactory->set('moduleHandler', $moduleHandler, true);

        // Create error handler early for handling exception
        $this->setErrorHanlder();
    }

    private function setErrorHanlder()<commit_msg>Fix mess code<commit_after><?php

namespace Phalex\Mvc;

use Phalcon\Mvc\Application as PhalconApplication;
use Phalex\Mvc\Module;
use Phalex\Config\Config as ConfigHandler;
use Phalex\Di;
use Phalex\Loader\Autoloader;
use Phalex\Events\Listener;

class Application
{
    /**
     *
     * @var Di\DiManager
     */
    protected $diManager;

    public function __construct(array $config)
    {
        $cacheModule   = !isset($config['cache_module']) ? null : $this->getCacheInstance($config['cache_module']);
        $cacheConfig   = !isset($config['cache_config']) ? null : $this->getCacheInstance($config['cache_config']);
        $moduleHandler = new Module($config['modules'], $config['autoload_module_paths'], $cacheModule);
        $entireAppConf = (new ConfigHandler($moduleHandler, $config['config_glob_paths'], $cacheConfig))->getConfig();
        $diFactory     = new Di\Di($entireAppConf);
        $diFactory->set('moduleHandler', $moduleHandler, true);

        $this->diManager = new Di\DiManager($diFactory);
        // Create error handler early for handling exception
        $this->setErrorHanlder();
    }

    private function setErrorHanlder()
{'fraction_non_alphanumeric': 0.13893653516295026, 'fraction_numerical': 0.0, 'mean_word_length': 3.9532908704883227, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3499053', 'n_tokens_mistral': 699, 'n_tokens_neox': 680, 'n_words': 135}