<commit_before><?php

/**
 * Linna Framework.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright (c) 2017, <NAME>
 * @license http://opensource.org/licenses/MIT MIT License
 */
declare(strict_types=1);

namespace Linna\Http;

/**
 * Describe valid routes.
 */
class Route implements RouteInterface
{
    protected $route = [
        'name'       => '',
        'method'     => '',
        'url'        => '',
        'model'      => '',
        'view'       => '',
        'controller' => '',
        'action'     => '',
        'default'    => false,
        'param'      => [],
        'callback'   => false,
    ];

    /**
     * Constructor.
     *
     * @param array $route
     */
    public function __construct(array $route = [])
    {
        $this->route = array_replace_recursive($this->route, $route);
    }

    /**
     * Return route name.
     * 
     * @return string
     */
    public function getName() : string
    {
        return $this->route['name'];
    }
    
    /**
     * Return route method.
     * 
     * @return string
     */
    public function getMethod() : string
    {
        return $this->route['method'];
    }
    
    /**
     * Return route url.
     * 
     * @return string
     */
    public function getUrl() : string
    {
        return $this->route['url'];
    }
    
    /**
     * Return model name.
     *
     * @return string
     */
    public function getModel(): string
    {
        return $this->route['model'];
    }

    /**
     * Return view name.
     *
     * @return string
     */
    public function getView(): string
    {
        return $this->route['view'];
    }

    /**
     * Return controller.
     *
     * @return string
     */
    public function getController(): string
    {
        return $this->route['controller'];
    }

    /**
     * Return action name.
     *
     * @return string
     */
    public function getAction(): string
    {
        return $this->route['action'];
    }

    /**
     * Return parameters.
     *
     * @return array
     */
    public function getParam(): array
    {
        return $this->route['param'];
    }

    /**
     * Return if route is set as default.
     *
     * @return bool
     */
    public function isDefault() : bool
    {
        return $this->route['dafault'];
    }

    /**
     * Return route callback.
     *
     * @return callable
     */
    public function getCallback() : callable
    {
        if (is_callable($this->route['callback'])) {
            return $this->route['callback'];
        }

        return function () {
        };
    }

    /**
     * Return route array.
     *
     * @return array
     */
    public function toArray(): array
    {
        return $this->route;
    }
}
<commit_msg>route element name fixed<commit_after><?php

/**
 * Linna Framework.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright (c) 2017, <NAME>
 * @license http://opensource.org/licenses/MIT MIT License
 */
declare(strict_types=1);

namespace Linna\Http;

/**
 * Describe valid routes.
 */
class Route implements RouteInterface
{
    protected $route = [
        'name'       => '',
        'method'     => '',
        'url'        => '',
        'model'      => '',
        'view'       => '',
        'controller' => '',
        'action'     => '',
        'default'    => false,
        'param'      => [],
        'callback'   => false,
    ];

    /**
     * Constructor.
     *
     * @param array $route
     */
    public function __construct(array $route = [])
    {
        $this->route = array_replace_recursive($this->route, $route);
    }

    /**
     * Return route name.
     * 
     * @return string
     */
    public function getName() : string
    {
        return $this->route['name'];
    }
    
    /**
     * Return route method.
     * 
     * @return string
     */
    public function getMethod() : string
    {
        return $this->route['method'];
    }
    
    /**
     * Return route url.
     * 
     * @return string
     */
    public function getUrl() : string
    {
        return $this->route['url'];
    }
    
    /**
     * Return model name.
     *
     * @return string
     */
    public function getModel(): string
    {
        return $this->route['model'];
    }

    /**
     * Return view name.
     *
     * @return string
     */
    public function getView(): string
    {
        return $this->route['view'];
    }

    /**
     * Return controller.
     *
     * @return string
     */
    public function getController(): string
    {
        return $this->route['controller'];
    }

    /**
     * Return action name.
     *
     * @return string
     */
    public function getAction(): string
    {
        return $this->route['action'];
    }

    /**
     * Return parameters.
     *
     * @return array
     */
    public function getParam(): array
    {
        return $this->route['param'];
    }

    /**
     * Return if route is set as default.
     *
     * @return bool
     */
    public function isDefault() : bool
    {
        return $this->route['default'];
    }

    /**
     * Return route callback.
     *
     * @return callable
     */
    public function getCallback() : callable
    {
        if (is_callable($this->route['callback'])) {
            return $this->route['callback'];
        }

        return function () {
        };
    }

    /**
     * Return route array.
     *
     * @return array
     */
    public function toArray(): array
    {
        return $this->route;
    }
}

{'fraction_non_alphanumeric': 0.15231187669990934, 'fraction_numerical': 0.001813236627379873, 'mean_word_length': 1.500453309156845, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 59, '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': '3677830', 'n_tokens_mistral': 1648, 'n_tokens_neox': 1612, 'n_words': 355}