<commit_before><?php
/**
 *
 */

namespace Mvc5\Route\Match;

use Mvc5\Http\Error\BadRequest;
use Mvc5\Route\Request;
use Mvc5\Route\Route;

class Scheme
{
    /**
     * @param Request $request
     * @param Route $route
     * @return Request|BadRequest
     */
    function __invoke(Request $request, Route $route)
    {
        return !$route->scheme() || in_array($request->scheme(), (array) $route->scheme())
            ? $request : new BadRequest;
    }
}
<commit_msg>tidy up<commit_after><?php
/**
 *
 */

namespace Mvc5\Route\Match;

use Mvc5\Http\Error\BadRequest;
use Mvc5\Route\Request;
use Mvc5\Route\Route;

class Scheme
{
    /**
     * @param Request $request
     * @param Route $route
     * @return bool
     */
    protected function match(Request $request, Route $route)
    {
        return in_array($request->scheme(), (array) $route->scheme());
    }

    /**
     * @param Request $request
     * @param Route $route
     * @return Request|BadRequest
     */
    function __invoke(Request $request, Route $route)
    {
        return !$route->scheme() || $this->match($request, $route) ? $request : new BadRequest;
    }
}

{'fraction_non_alphanumeric': 0.15404699738903394, 'fraction_numerical': 0.006962576153176675, 'mean_word_length': 2.7096774193548385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '5907990', 'n_tokens_mistral': 377, 'n_tokens_neox': 375, 'n_words': 82}