-
-
Notifications
You must be signed in to change notification settings - Fork 189
/
RouterInterface.php
43 lines (39 loc) · 1.55 KB
/
RouterInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Neos\Flow\Mvc\Routing;
/*
* This file is part of the Neos.Flow package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/
use Neos\Flow\Mvc\Exception\NoMatchingRouteException;
use Neos\Flow\Mvc\Routing\Dto\ResolveContext;
use Neos\Flow\Mvc\Routing\Dto\RouteContext;
use Psr\Http\Message\UriInterface;
/**
* Contract for a Web Router
*/
interface RouterInterface
{
/**
* Iterates through all configured routes and calls matches() on them.
* Returns the matchResults of the matching route.
*
* @param RouteContext $routeContext The Route Context containing the current HTTP Request and, optional, Routing RouteParameters
* @return array The results of the matching route
* @throws NoMatchingRouteException if no route matched the $routeContext
*/
public function route(RouteContext $routeContext): array;
/**
* Walks through all configured routes and calls their respective resolves-method.
* When a matching route is found, the corresponding URI is returned.
*
* @param ResolveContext $resolveContext The Resolve Context containing the route values, the request URI and some flags to be resolved
* @return UriInterface The resolved Uri
* @throws NoMatchingRouteException if no route could resolve the given $resolveContext
*/
public function resolve(ResolveContext $resolveContext): UriInterface;
}