<commit_before><?php
/**
 * Spiral Framework.
 *
 * @license   MIT
 * @author    <NAME> (Wolfy-J)
 */
namespace Spiral\Http\Routing;

use Cocur\Slugify\SlugifyInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UriInterface;
use Spiral\Core\Container;
use Spiral\Core\ContainerInterface;
use Spiral\Http\Exceptions\RouteException;

/**
 * Declares ability to route.
 */
interface RouteInterface
{
    /**
     * Controller and action in route targets and createURL route name has to be separated like
     * that.
     */
    const SEPARATOR = '::';

    /**
     * @return string
     */
    public function getName();

    /**
     * Check if route matched with provided request.
     *
     * @param ServerRequestInterface $request
     * @param string                 $basePath
     * @return bool
     * @throws RouteException
     */
    public function match(ServerRequestInterface $request, $basePath = '/');

    /**
     * Execute route on given request. Has to be called after match method.
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface      $response
     * @param ContainerInterface     $container Spiral container is needed (due scoping).
     * @return ResponseInterface
     */
    public function perform(
        ServerRequestInterface $request,
        ResponseInterface $response,
        ContainerInterface $container
    );

    /**
     * Get route copy with different parameters.
     *
     * @todo i don't like this method, find alternative, DO NOT USE IN YOUR CODE
     * @param string $name
     * @param array  $defaults
     * @return RouteInterface
     */
    public function copy($name, array $defaults);

    /**
     * Generate valid route URL using route name and set of parameters.
     *
     * @param array            $parameters Accepts only arrays at this moment.
     * @param string           $basePath
     * @param SlugifyInterface $slugify
     * @return UriInterface
     * @throws RouteException
     */
    public function uri($parameters = [], $basePath = '/', SlugifyInterface $slugify = null);
}<commit_msg>Update RouteInterface.php<commit_after><?php
/**
 * Spiral Framework.
 *
 * @license   MIT
 * @author    <NAME> (Wolfy-J)
 */
namespace Spiral\Http\Routing;

use Cocur\Slugify\SlugifyInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\UriInterface;
use Spiral\Core\Container;
use Spiral\Core\ContainerInterface;
use Spiral\Http\Exceptions\RouteException;

/**
 * Declares ability to route.
 */
interface RouteInterface
{
    /**
     * Controller and action in route targets and createURL route name has to be separated like
     * that.
     */
    const SEPARATOR = '::';

    /**
     * @return string
     */
    public function getName();

    /**
     * Check if route matched with provided request.
     *
     * @param ServerRequestInterface $request
     * @param string                 $basePath
     * @return bool
     * @throws RouteException
     */
    public function match(ServerRequestInterface $request, $basePath = '/');

    /**
     * Execute route on given request. Has to be called after match method.
     *
     * @param ServerRequestInterface $request
     * @param ResponseInterface      $response
     * @param ContainerInterface     $container Spiral container is needed (due scoping).
     * @return ResponseInterface
     */
    public function perform(
        ServerRequestInterface $request,
        ResponseInterface $response,
        ContainerInterface $container
    );

    /**
     * Get route copy with different parameters.
     *
     * @internal DO NOT USE IN YOUR CODE
     * @todo i don't like this method, find alternative
     * @param string $name
     * @param array  $defaults
     * @return RouteInterface
     */
    public function copy($name, array $defaults);

    /**
     * Generate valid route URL using route name and set of parameters.
     *
     * @param array            $parameters Accepts only arrays at this moment.
     * @param string           $basePath
     * @param SlugifyInterface $slugify
     * @return UriInterface
     * @throws RouteException
     */
    public function uri($parameters = [], $basePath = '/', SlugifyInterface $slugify = null);
}
{'fraction_non_alphanumeric': 0.09554432705558108, 'fraction_numerical': 0.0, 'mean_word_length': 2.5755336617405584, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '7580429', 'n_tokens_mistral': 1165, 'n_tokens_neox': 1151, 'n_words': 368}