<commit_before><?php
$dispatcher = $di->get('web_dispatcher');

$dispatcher->setObjectParam('controller');
$dispatcher->setMethodParam('action');

$dispatcher->setObject('no_route', function ($request, $response) {
    $response->status->set('404', 'Not Found');
    $response->content->set(
        'No route for '
        . $request->method->get() . ' '
        . $request->url->get(PHP_URL_PATH)
        . PHP_EOL
    );
});

$dispatcher->setObject('no_controller', function ($request, $response) {
    $response->status->set('404', 'Not Found');
    $response->content->set(
        'No controller for '
        . $request->method->get() . ' '
        . $request->url->get(PHP_URL_PATH) . PHP_EOL . PHP_EOL
        . 'Params: ' . var_export($request->params->get(), true)
        . PHP_EOL
    );
});<commit_msg>use injection, not params, for request/response<commit_after><?php
$dispatcher = $di->get('web_dispatcher');
$request = $di->get('web_request');
$response = $di->get('web_response');

$dispatcher->setObjectParam('controller');
$dispatcher->setMethodParam('action');

$dispatcher->setObject('no_route', function () use ($request, $response) {
    $response->status->set('404', 'Not Found');
    $response->content->set(
        'No route for '
        . $request->method->get() . ' '
        . $request->url->get(PHP_URL_PATH)
        . PHP_EOL
    );
});

$dispatcher->setObject('no_controller', function () use ($request, $response) {
    $response->status->set('404', 'Not Found');
    $response->content->set(
        'No controller for '
        . $request->method->get() . ' '
        . $request->url->get(PHP_URL_PATH) . PHP_EOL . PHP_EOL
        . 'Params: ' . var_export($request->params->get(), true)
        . PHP_EOL
    );
});
{'fraction_non_alphanumeric': 0.20467502850627137, 'fraction_numerical': 0.0068415051311288486, 'mean_word_length': 3.249394673123487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, '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': '2100201', 'n_tokens_mistral': 574, 'n_tokens_neox': 567, 'n_words': 87}