-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteSetInterface.php
More file actions
69 lines (61 loc) · 1.41 KB
/
RouteSetInterface.php
File metadata and controls
69 lines (61 loc) · 1.41 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/*
* This file is part of Berlioz framework.
*
* @license https://opensource.org/licenses/MIT MIT License
* @copyright 2020 Ronan GIRON
* @author Ronan GIRON <https://github.com/ElGigi>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code, to the root.
*/
declare(strict_types=1);
namespace Berlioz\Router;
use Countable;
use Generator;
use Psr\Http\Message\ServerRequestInterface;
/**
* Interface RouteSetInterface.
*
* @package Berlioz\Router
*/
interface RouteSetInterface extends Countable
{
/**
* Count number of routes.
*
* @return int
*/
public function count(): int;
/**
* Get a route by name.
*
* @param string $name
*
* @return Route|null
*/
public function getRoute(string $name): ?Route;
/**
* Get routes.
*
* @return Generator<RouteInterface>
*/
public function getRoutes(): Generator;
/**
* Search route.
*
* @param ServerRequestInterface $request
* @param array $attributes
*
* @return RouteInterface|null
*/
public function searchRoute(ServerRequestInterface $request, array &$attributes = []): ?RouteInterface;
/**
* Add route.
*
* @param RouteInterface ...$route
*
* @return static
*/
public function addRoute(RouteInterface ...$route): static;
}