Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
8 | class InstanceOfGuard implements Guard |
||
9 | { |
||
10 | use ErrorMessagesBase; |
||
11 | use SingleInput; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $className; |
||
17 | |||
18 | 5 | public function __construct($input, string $className, object $defaultValue = null) |
|
19 | { |
||
20 | 5 | $this->className = $className; |
|
21 | 5 | $this->input = $input; |
|
22 | 5 | $this->value = $defaultValue; |
|
23 | 5 | } |
|
24 | |||
25 | 4 | protected function validation($input, &$value): bool |
|
33 | } |
||
34 | |||
35 | 3 | public function value(): ?object |
|
40 | } |
||
41 | } |
||
42 |