<commit_before><?php

// load composers autoloader
require __DIR__ . '/../../vendor/autoload.php';

// load config
$config = require __DIR__ . '/../../config.php';

// create app
$app = new \Slim\App([
    'settings' => [
        'displayErrorDetails' => $config['debugging']
    ]
]);

// prepare database
$capsule = new \Illuminate\Database\Capsule\Manager();
$capsule->addConnection([
    'driver'    => 'mysql',
    'host'      => $config['database']['host'],
    'database'  => $config['database']['name'],
    'username'  => $config['database']['username'],
    'password'  => $config['database']['password'],
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
]);

$capsule->bootEloquent();

// routing
$app->post('/cards', \Dingbat\Action\Card\Create::class . ':run');
$app->get('/cards', \Dingbat\Action\Card\GetAll::class . ':run');
$app->get('/cards/{id}', \Dingbat\Action\Card\GetOne::class . ':run');
$app->delete('/cards/{id}', \Dingbat\Action\Card\Delete::class . ':run');
$app->put('/cards/{id}', \Dingbat\Action\Card\Update::class . ':run');

$app->post('/tasks', \Dingbat\Action\Task\Create::class . ':run');
$app->get('/tasks/{id}', \Dingbat\Action\Task\GetOne::class . ':run');
$app->get('/tasks', \Dingbat\Action\Task\GetAll::class . ':run');
$app->put('/tasks/{id}', \Dingbat\Action\Task\Update::class . ':run');
$app->delete('/tasks/{id}', \Dingbat\Action\Task\Delete::class . ':run');

// start app
$app->run();<commit_msg>added regex to route placeholders<commit_after><?php

// load composers autoloader
require __DIR__ . '/../../vendor/autoload.php';

// load config
$config = require __DIR__ . '/../../config.php';

// create app
$app = new \Slim\App([
    'settings' => [
        'displayErrorDetails' => $config['debugging']
    ]
]);

// prepare database
$capsule = new \Illuminate\Database\Capsule\Manager();
$capsule->addConnection([
    'driver'    => 'mysql',
    'host'      => $config['database']['host'],
    'database'  => $config['database']['name'],
    'username'  => $config['database']['username'],
    'password'  => $config['database']['password'],
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
]);

$capsule->bootEloquent();

// routing
$app->post('/cards', \Dingbat\Action\Card\Create::class . ':run');
$app->get('/cards', \Dingbat\Action\Card\GetAll::class . ':run');
$app->get('/cards/{id:\d+}', \Dingbat\Action\Card\GetOne::class . ':run');
$app->put('/cards/{id:\d+}', \Dingbat\Action\Card\Update::class . ':run');
$app->delete('/cards/{id:\d+}', \Dingbat\Action\Card\Delete::class . ':run');

$app->post('/tasks', \Dingbat\Action\Task\Create::class . ':run');
$app->get('/tasks', \Dingbat\Action\Task\GetAll::class . ':run');
$app->get('/tasks/{id:\d+}', \Dingbat\Action\Task\GetOne::class . ':run');
$app->put('/tasks/{id:\d+}', \Dingbat\Action\Task\Update::class . ':run');
$app->delete('/tasks/{id:\d+}', \Dingbat\Action\Task\Delete::class . ':run');

// start app
$app->run();
{'fraction_non_alphanumeric': 0.27091633466135456, 'fraction_numerical': 0.0013280212483399733, 'mean_word_length': 3.9312602291325693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '7180250', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1063, 'n_words': 157}