<commit_before><?php

use H4D\Leveret\Application;
use H4D\Leveret\Validation\Adapters\H4DConstraintAdapter;
use H4D\Validator\Constraints\Enum;

require_once(__DIR__.'/../../vendor/autoload.php');

$app = new Application();
$app->registerRoute('GET', '/hello/:(string)name')
    ->addRequestConstraints('name', new H4DConstraintAdapter((new Enum())->setOptions(['paco', 'maria'])))
    ->setAction(
        function ($name) use ($app)
        {
            $isValid = $app->isValidRequest();
            var_dump($isValid);
            if (!$isValid)
            {
                throw new \Exception($app->getRequestConstraintsViolationMessagesAsString());
            }
            $app->getResponse()->setBody('Hello '.$name);
        });
$app->run();<commit_msg>Remove var_dump from test index.<commit_after><?php

use H4D\Leveret\Application;
use H4D\Leveret\Validation\Adapters\H4DConstraintAdapter;
use H4D\Validator\Constraints\Enum;

require_once(__DIR__.'/../../vendor/autoload.php');

$app = new Application();
$app->registerRoute('GET', '/hello/:(string)name')
    ->addRequestConstraints('name', new H4DConstraintAdapter((new Enum())->setOptions(['paco', 'maria'])))
    ->setAction(
        function ($name) use ($app)
        {
            $isValid = $app->isValidRequest();
            if (!$isValid)
            {
                throw new \Exception($app->getRequestConstraintsViolationMessagesAsString());
            }
            $app->getResponse()->setBody('Hello '.$name);
        });
$app->run();
{'fraction_non_alphanumeric': 0.17662508207485225, 'fraction_numerical': 0.006565988181221274, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '3999644', 'n_tokens_mistral': 449, 'n_tokens_neox': 457, 'n_words': 70}