Conditions | 7 |
Paths | 6 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
48 | 6 | private function doGetType($object, bool $recursive): string |
|
49 | { |
||
50 | 6 | if ($object instanceof Node) { |
|
51 | 1 | return sprintf('%s: %s', $object->identity(), implode(', ', $object->labels())); |
|
52 | 5 | } elseif (is_array($object) && $recursive) { |
|
53 | 3 | if (empty($object)) { |
|
54 | 1 | return 'Empty array'; |
|
55 | } |
||
56 | 2 | $ret = []; |
|
57 | 2 | foreach ($object as $o) { |
|
58 | 2 | $ret[] = $this->doGetType($o, false); |
|
59 | } |
||
60 | |||
61 | 2 | return sprintf('[%s]', implode(', ', $ret)); |
|
62 | } |
||
63 | |||
64 | 4 | return is_object($object) ? get_class($object) : gettype($object); |
|
65 | } |
||
66 | } |
||
67 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.