| Conditions | 5 |
| Paths | 2 |
| Total Lines | 4 |
| Code Lines | 2 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 18 | protected function checkType($value): void |
|
| 35 | { |
||
| 36 | 18 | if (gettype($value) !== strtolower($this->valueType) && !$value instanceof $this->valueType && !($this->valueType === 'callable' && is_callable($value))) { |
|
| 37 | 2 | throw new \InvalidArgumentException('Value must be of type ' . $this->valueType . " but value of type " . gettype($value) . " given."); |
|
| 38 | } |
||
| 50 | } |