-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
ParameterAwareRoutePartInterface.php
45 lines (41 loc) · 1.84 KB
/
ParameterAwareRoutePartInterface.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
44
45
<?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\Routing\Dto\ResolveResult;
use Neos\Flow\Mvc\Routing\Dto\RouteParameters;
/**
* Contract for Route parts that are aware of Routing RouteParameters
*
* This extends the RoutePartInterface by a new method that allows Routing RouteParameters to be passed in when
* matching an incoming request.
*
* @api
*/
interface ParameterAwareRoutePartInterface extends RoutePartInterface
{
/**
* @param string &$routePath The request path to be matched - without query parameters, host and fragment.
* @param RouteParameters $parameters The Routing RouteParameters that can be registered via HTTP middleware
* @return boolean true if Route Part matched $routePath, otherwise false.
*/
public function matchWithParameters(&$routePath, RouteParameters $parameters);
/**
* Checks whether this Route Part corresponds to the given $routeValues.
* This method does not only check if the Route Part matches. It also
* removes resolved elements from $routeValues-Array.
* This is why $routeValues has to be passed by reference.
*
* @param array &$routeValues An array with key/value pairs to be resolved by Dynamic Route Parts.
* @param RouteParameters $parameters The Routing RouteParameters that can be registered via HTTP middleware
* @return bool|ResolveResult true or an instance of ResolveResult if Route Part can resolve one or more $routeValues elements, otherwise false.
*/
public function resolveWithParameters(array &$routeValues, RouteParameters $parameters);
}