Collector/Twig/Neo4jResultExtension.php
private function doGetType($object, bool $recursive): string
    {
        if ($object instanceof Node) {
            return sprintf('%s: %s', $object->identity(), implode(', ', $object->labels()));
        } elseif (is_array($object) && $recursive) {
            if (empty($object)) {
                return 'Empty array';
            }
            $ret = [];
            foreach ($object as $o) {
                $ret[] = $this->doGetType($o, false);
            }

            return sprintf('[%s]', implode(', ', $ret));
        }

        return is_object($object) ? get_class($object) : gettype($object);
    }
private function doGetType($object, bool $recursive): string
    {
        if ($object instanceof Node) {
            return sprintf('%s: %s', $object->identity(), implode(', ', $object->labels()));
        } elseif (is_array($object) && $recursive) {
            if (empty($object)) {
                return 'Empty array';
            }
            $ret = [];
            foreach ($object as $o) {
                $ret[] = $this->doGetType($o, false);
            }

            return sprintf('[%s]', implode(', ', $ret));
        }

        return is_object($object) ? get_class($object) : gettype($object);
    }
@param mixed $object
@param bool  $recursive

@return string