Conditions | 6 |
Paths | 10 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function check($value): bool |
||
34 | { |
||
35 | 2 | $this->requireParameters($this->fillableParams); |
|
36 | |||
37 | if (is_object($type = $this->parameter('type'))) { |
||
38 | 2 | $type = get_class($type); |
|
39 | } |
||
40 | |||
41 | if (is_object($value)) { |
||
42 | 2 | return $value instanceof $type || get_class($value) === $type; |
|
43 | } |
||
44 | |||
45 | 2 | return is_subclass_of($value, $type) || is_a($value, $type) || $value === $type; |
|
46 | } |
||
48 |