<commit_before><?php
/* ===========================================================================
 * Copyright 2013-2017 The Opis Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================================ */

namespace Opis\HttpRouting;

use Opis\Routing\Route as BaseRoute;

/**
 * Class Route
 * @package Opis\HttpRouting
 *
 * @method RouteCollection getRouteCollection(): \Opis\Routing\RouteCollection
 */
class Route extends BaseRoute
{
    /** @var array  */
    protected $cache = [];

    /**
     * @return array
     */
    public function getWildcards(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getWildcards() + $collection->getWildcards();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return array
     */
    public function getDefaults(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getDefaults() + $collection->getDefaults();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return callable[]
     */
    public function getBindings(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getBindings() + $collection->getBindings();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return CallbackFilter[]
     */
    public function getFilters(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = $this->get('filters', []) + $collection->getFilters();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * Get error
     *
     * @param   int $code
     *
     * @return  callable|null
     */
    public function getError(int $code)
    {
        $errors = $this->get('http_errors', []);<commit_msg>Fixed return type<commit_after><?php
/* ===========================================================================
 * Copyright 2013-2017 The Opis Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============================================================================ */

namespace Opis\HttpRouting;

use Opis\Routing\Route as BaseRoute;
use Opis\Routing\RouteCollection;

/**
 * Class Route
 * @package Opis\HttpRouting
 *
 * @method RouteCollection getRouteCollection(): RouteCollection
 */
class Route extends BaseRoute
{
    /** @var array  */
    protected $cache = [];

    /**
     * @return array
     */
    public function getWildcards(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getWildcards() + $collection->getWildcards();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return array
     */
    public function getDefaults(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getDefaults() + $collection->getDefaults();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return callable[]
     */
    public function getBindings(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = parent::getBindings() + $collection->getBindings();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * @return callable[]
     */
    public function getFilters(): array
    {
        if(!isset($this->cache[__FUNCTION__])){
            /** @var RouteCollection $collection */
            $collection = $this->collection;
            $this->cache[__FUNCTION__] = $this->get('filters', []) + $collection->getFilters();
        }
        return $this->cache[__FUNCTION__];
    }

    /**
     * Get error
     *
     * @param   int $code
     *
     * @return  callable|null
     */
    public function getError(int $code)
    {
        $errors = $this->get('http_errors', []);
{'fraction_non_alphanumeric': 0.1818502824858757, 'fraction_numerical': 0.00423728813559322, 'mean_word_length': 2.659560723514212, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2522271', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1465, 'n_words': 378}