<commit_before><?php
/**
 * Application DIC Configuration
 */

use Slim\Container;

// Get detailed information while development
if ($settings['mode'] === 'development') {
    $settings['displayErrorDetails'] = true;
}

/**
 * Registering all defined providers
 */
foreach ($settings['providers'] as $provider) {
    $container->register(new $provider);
}

if ($settings['mode'] !== 'development') {
    /**
     * Overwrite default Slim errorHandler container
     */
    $container['errorHandler'] = function (Container $c) use ($settings) {
        $handler = new App\Handlers\ErrorHandler($settings['displayErrorDetails']);
        $handler->setView($c['view']);

        return $handler;
    };

    /**
     * Overwrite default Slim notFoundHandler container
     */
    $container['notFoundHandler'] = function (Container $c) {
        $handler = new App\Handlers\NotFoundHandler;
        $handler->setView($c['view']);

        return $handler;
    };
}

/**<commit_msg>Only errorHandler that customized for non-development environment<commit_after><?php
/**
 * Application DIC Configuration
 */

use Slim\Container;

// Get detailed information while development
if ($settings['mode'] === 'development') {
    $settings['displayErrorDetails'] = true;
}

/**
 * Registering all defined providers
 */
foreach ($settings['providers'] as $provider) {
    $container->register(new $provider);
}

if ($settings['mode'] !== 'development') {
    /**
     * Overwrite default Slim errorHandler container
     */
    $container['errorHandler'] = function (Container $c) use ($settings) {
        $handler = new App\Handlers\ErrorHandler($settings['displayErrorDetails']);
        $handler->setView($c['view']);

        return $handler;
    };
}

/**
 * Overwrite default Slim notFoundHandler container
 */
$container['notFoundHandler'] = function (Container $c) {
    $handler = new App\Handlers\NotFoundHandler;
    $handler->setView($c['view']);

    return $handler;
};

/**
{'fraction_non_alphanumeric': 0.160262891809909, 'fraction_numerical': 0.0, 'mean_word_length': 3.711904761904762, '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': '1028882', 'n_tokens_mistral': 547, 'n_tokens_neox': 537, 'n_words': 128}