1 | <?php |
||
13 | class Router |
||
14 | { |
||
15 | /** @var \Opis\Pattern\RegexBuilder */ |
||
16 | protected $builder; |
||
17 | |||
18 | /** @var array */ |
||
19 | protected $routes = []; |
||
20 | |||
21 | /** @var \LBHurtado\Missive\Missive */ |
||
22 | public $missive; |
||
23 | |||
24 | /** @var ContainerInterface */ |
||
25 | protected $container; |
||
26 | |||
27 | /** |
||
28 | * Router constructor. |
||
29 | * Capture the Missive instance from the container. |
||
30 | * Instantiate RegexBuilder that ignores casing. |
||
31 | * @param Missive $missive |
||
32 | */ |
||
33 | public function __construct(Missive $missive) |
||
41 | |||
42 | /** |
||
43 | * @param string $route |
||
44 | * @param string|callable $action |
||
45 | * @return Router |
||
46 | */ |
||
47 | public function register(string $route, $action): self |
||
55 | |||
56 | /** |
||
57 | * Sets the SMS property of Missive before |
||
58 | * executing the contents of them sms |
||
59 | * @param SMSAbstract $sms |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function process(SMSAbstract $sms) |
||
68 | |||
69 | /** |
||
70 | * @param string $path |
||
71 | * @return mixed |
||
72 | */ |
||
73 | public function execute(string $path) |
||
90 | |||
91 | protected function do($action, $path, $values) |
||
106 | |||
107 | /** |
||
108 | * Make an action for an invokable controller. |
||
109 | * |
||
110 | * @param string $action |
||
111 | * @return string |
||
112 | * @throws UnexpectedValueException |
||
113 | */ |
||
114 | protected function makeInvokableAction($action) |
||
124 | |||
125 | /** |
||
126 | * @param $callback |
||
127 | * @return array|string|Closure |
||
128 | * @throws UnexpectedValueException |
||
129 | * @throws NotFoundExceptionInterface |
||
130 | */ |
||
131 | protected function getCallable($callback) |
||
155 | |||
156 | /** |
||
157 | * @param ContainerInterface $container |
||
158 | */ |
||
159 | public function setContainer(ContainerInterface $container) |
||
163 | } |
||
164 |
This check looks for function calls that miss required arguments.