Conditions | 6 |
Paths | 3 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
56 | protected function validateValue(string $value): void |
||
57 | { |
||
58 | if (\is_object($value) && !\method_exists($value, '__toString')) { |
||
59 | throw new InvalidArgumentException('Object cannot be represented as a string'); |
||
60 | } |
||
61 | |||
62 | if (!\is_object($value) && !\is_scalar($value) && !empty($value)) { |
||
63 | throw new InvalidArgumentException('Given value is not a scalar'); |
||
64 | } |
||
65 | } |
||
66 | |||
72 |