1 | <?php |
||
2 | /** |
||
3 | * |
||
4 | */ |
||
5 | |||
6 | namespace Mvc5\Route\Match\Plugin; |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
7 | |||
8 | use Mvc5\Route\Route; |
||
9 | |||
10 | use function in_array; |
||
11 | |||
12 | use const Mvc5\OPTIONAL; |
||
13 | |||
14 | trait Optional |
||
15 | { |
||
16 | /** |
||
17 | * @param Route $route |
||
18 | * @param string $name |
||
19 | * @return bool |
||
20 | */ |
||
21 | 7 | protected function optional(Route $route, string $name) : bool |
|
22 | { |
||
23 | 7 | return in_array($name, (array) $route[OPTIONAL]); |
|
24 | } |
||
25 | } |
||
26 |