<commit_before><?php

namespace Fias\ApiAction;

use Grace\DBAL\ConnectionAbstract\ConnectionInterface;

class Handler
{
    public static function handleRequest($uri, $params, ConnectionInterface $db)
    {
        $uri = rtrim($uri, '/');
        switch ($uri) {
            case '/api/complete':
                return static::complete($db, $params);
                break;
            case '/api/validate':
                return static::validate($db, $params);
                break;
            default:
                throw new HttpException(404);
                break;
        }
    }
<commit_msg>ошибка в параметрах<commit_after><?php

namespace Fias\ApiAction;

use Grace\DBAL\ConnectionAbstract\ConnectionInterface;

class Handler
{
    public static function handleRequest($uri, $params, ConnectionInterface $db)
    {
        if (!preg_match('/^[^\?]+(|\/)/', $uri, $uri)) {
            throw new HttpException(404);
        }

        $uri = rtrim(array_shift($uri), '/');
        switch ($uri) {
            case '/api/complete':
                return static::complete($db, $params);
                break;
            case '/api/validate':
                return static::validate($db, $params);
                break;
            default:
                throw new HttpException(404);
                break;
        }
    }

{'fraction_non_alphanumeric': 0.12658227848101267, 'fraction_numerical': 0.006701414743112435, 'mean_word_length': 1.7428571428571429, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6414073', 'n_tokens_mistral': 372, 'n_tokens_neox': 352, 'n_words': 79}