Total Complexity | 3 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
17 | class Records |
||
18 | { |
||
19 | /** |
||
20 | * @var RouteCollector |
||
21 | */ |
||
22 | private $collector = null; |
||
23 | |||
24 | /** |
||
25 | * @var Dispatcher |
||
26 | */ |
||
27 | private $dispatcher = null; |
||
28 | |||
29 | /** |
||
30 | * Records constructor. |
||
31 | */ |
||
32 | public function __construct() |
||
33 | { |
||
34 | $this->collector = new RouteCollector(new Std, new GCBGenerator); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return Dispatcher |
||
39 | */ |
||
40 | public function dispatcher() : Dispatcher |
||
41 | { |
||
42 | return $this->dispatcher ?? $this->dispatcher = new GCBDispatcher($this->collector->getData()); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param string $method |
||
47 | * @param string $uri |
||
48 | * @param callable $processor |
||
49 | */ |
||
50 | public function accept(string $method, string $uri, callable $processor) : void |
||
53 | } |
||
54 | } |
||
55 |