Conditions | 7 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 8.323 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 8 | private static function convertObjectToString(object $variable): string |
|
19 | { |
||
20 | 8 | if (PHP_VERSION_ID > 80100) { // PHP 8.1 |
|
21 | 8 | if ($variable instanceof UnitEnum) { // BackedEnum implements UnitEnum |
|
22 | 8 | return ($variable instanceof BackedEnum) ? strval($variable->value) : $variable->name; |
|
23 | } |
||
24 | } |
||
25 | 8 | if (class_exists(Stringable::class) && $variable instanceof Stringable) { |
|
26 | return strval($variable); |
||
27 | } |
||
28 | 8 | if (is_callable([$variable, '__toString'])) { |
|
29 | 8 | return $variable->__toString(); |
|
30 | } |
||
31 | |||
32 | throw new InvalidArgumentException( |
||
33 | sprintf('Value of type %s that cannot be parsed as string', get_class($variable)) |
||
34 | ); |
||
37 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths