<commit_before><?php

$app->get('/weather/{type}/', function($type) use($app) {

    /** @var \Service\WeatherService $weatherService */
    $weatherService = $app['weatherService'];

    if (!in_array($type, ['current', 'detail', 'icon'])) {
        $app->abort(404, 'Type not found');
    }

    return $app['twig']->render('weather/' . $type . '.html.twig', [
        'forecast' => $weatherService->getForecastList(),
    ]);
});

$app->get('/weather/update', function() use($app) {
    /** @var \Service\WeatherService $weatherService */
    $weatherService = $app['weatherService'];
    return $weatherService->updateForecast();
});
<commit_msg>Added access control<commit_after><?php

$app->get('/weather/{type}/', function($type) use($app) {

    /** @var \Service\WeatherService $weatherService */
    $weatherService = $app['weatherService'];

    if (!in_array($type, ['current', 'detail', 'icon'])) {
        $app->abort(404, 'Type not found');
    }
    
    header('Access-Control-Allow-Origin: *');

    return $app['twig']->render('weather/' . $type . '.html.twig', [
        'forecast' => $weatherService->getForecastList(),
    ]);
});

$app->get('/weather/update', function() use($app) {
    /** @var \Service\WeatherService $weatherService */
    $weatherService = $app['weatherService'];
    return $weatherService->updateForecast();
});

{'fraction_non_alphanumeric': 0.22238586156111928, 'fraction_numerical': 0.004418262150220913, 'mean_word_length': 3.8362989323843415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3847075', 'n_tokens_mistral': 449, 'n_tokens_neox': 420, 'n_words': 71}