<commit_before><?php

require_once __DIR__ . '/bootstrap.php';

use Symfony\Component\HttpFoundation\Response;

$app = new Silex\Application();

$app->get('/', function(){
    return new Response('Welcome to my new Silex App!');
});

$app->error(function(\Exception $exc, $code){
    return new Response('Oops! Something went terribly wrong...: ' . $exc->getMessage());
});

return $app;<commit_msg>Error handler and conditional messages. Also documentation for actions, on app.php.<commit_after><?php

require_once __DIR__ . '/bootstrap.php';

use Symfony\Component\HttpFoundation\Response;

$app = new Silex\Application();

/*
 * Home action.
 */
$app->get('/', function(){
    return new Response('Welcome to my new Silex App!');
});

/*
 * Error handler
 */
$app->error(function(\Exception $exc, $code){
    switch ($code){
        case 404:
            $message = 'Oops! Something went terribly wrong...';
            break;
        default:
            $message = 'Oops! Something went wrong, but no worries :)';
    }
    return new Response($message . ': ' . $exc->getMessage());
});

return $app;
{'fraction_non_alphanumeric': 0.167420814479638, 'fraction_numerical': 0.0027149321266968325, 'mean_word_length': 3.424, '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': '6662547', 'n_tokens_mistral': 334, 'n_tokens_neox': 327, 'n_words': 93}