-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoutingConfigurator.php
87 lines (70 loc) · 1.73 KB
/
RoutingConfigurator.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
declare(strict_types=1);
namespace Snicco\Component\HttpRouting\Routing\RoutingConfigurator;
use Closure;
use Snicco\Component\HttpRouting\Routing\Route\Routes;
interface RoutingConfigurator
{
/**
* @var string
*/
public const MIDDLEWARE_KEY = 'middleware';
/**
* @var string
*/
public const PREFIX_KEY = 'prefix';
/**
* @var string
*/
public const NAMESPACE_KEY = 'namespace';
/**
* @var string
*/
public const NAME_KEY = 'name';
/**
* @var string
*/
public const FRONTEND_MIDDLEWARE = 'frontend';
/**
* @var string
*/
public const API_MIDDLEWARE = 'api';
/**
* @var string
*/
public const ADMIN_MIDDLEWARE = 'admin';
/**
* @var string
*/
public const GLOBAL_MIDDLEWARE = 'global';
/**
* @param string|string[] $middleware
*
* @return static
*/
public function middleware($middleware);
/**
* @return static
*/
public function name(string $name);
/**
* @return static
*/
public function namespace(string $namespace);
/**
* @param Closure(static) $create_routes
* @param array{
* namespace?:string,
* prefix?:string,
* name?:string,
* middleware?: string[]
* } $extra_attributes
*/
public function group(Closure $create_routes, array $extra_attributes = []): void;
/**
* @param Closure(static)|string $file_or_closure Either the full path to route file that will
* return a closure or the closure itself
*/
public function include($file_or_closure): void;
public function configuredRoutes(): Routes;
}