Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 90% |
Changes | 0 |
1 | <?php |
||
20 | class GuardDispatcher |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * @var GuardContract[] |
||
25 | */ |
||
26 | protected $guards = []; |
||
27 | |||
28 | /** |
||
29 | * @var Throwable|null |
||
30 | */ |
||
31 | protected $exception; |
||
32 | |||
33 | /** |
||
34 | * GuardDispatcher constructor. |
||
35 | * @param $guards |
||
36 | * @param $exception |
||
37 | */ |
||
38 | 2 | public function __construct($guards, $exception = null) |
|
39 | { |
||
40 | 2 | $this->guards = (new GuardsResolver($guards))->resolve(); |
|
41 | 2 | $this->exception = isset($exception) ? (new ExceptionResolver($exception))->resolve() : null; |
|
42 | 2 | } |
|
43 | |||
44 | 2 | public function dispatch() |
|
52 | } |
||
53 | } |
||
56 |