Conditions | 6 |
Paths | 6 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
60 | protected function matchScalar(string $name, $value): bool |
||
61 | { |
||
62 | switch (true) { |
||
63 | case $this->isBuiltin($name): |
||
64 | return $this->matchBuiltin($name, $value); |
||
65 | |||
66 | case $name === 'mixed': |
||
67 | return true; |
||
68 | |||
69 | case $name === 'null': |
||
70 | case $name === 'void': |
||
71 | return $value === null; |
||
72 | |||
73 | case \class_exists($name): |
||
74 | return $value instanceof $name; |
||
75 | |||
76 | default: |
||
77 | @\trigger_error('Unrecognized type-hint "' . $name . '"'); |
||
|
|||
78 | return true; |
||
79 | } |
||
80 | } |
||
81 | |||
112 |
If you suppress an error, we recommend checking for the error condition explicitly: