src/Neutrino/Debug/Reflexion.php
private static function retrieveReflectionElement(\ReflectionClass $reflectionClass, $type, $name)
    {
        if (!isset(self::$cache[$reflectionClass->getName()][$type][$name])) {
            try {
                /** @var \ReflectionMethod|\ReflectionProperty $reflection */
                $reflection = $reflectionClass->{'get' . Str::capitalize($type)}($name);
                $reflection->setAccessible(true);

                self::$cache[$reflectionClass->getName()][$type][$name] = $reflection;
            } catch (\ReflectionException $e) {
                if ($reflectionClass = $reflectionClass->getParentClass()) {
                    return self::retrieveReflectionElement($reflectionClass, $type, $name);
                }

                throw $e;
            }
        }

        return self::$cache[$reflectionClass->getName()][$type][$name];
    }
private static function retrieveReflectionElement(\ReflectionClass $reflectionClass, $type, $name)
    {
        if (!isset(self::$cache[$reflectionClass->getName()][$type][$name])) {
            try {
                /** @var \ReflectionMethod|\ReflectionProperty $reflection */
                $reflection = $reflectionClass->{'get' . Str::capitalize($type)}($name);
                $reflection->setAccessible(true);

                self::$cache[$reflectionClass->getName()][$type][$name] = $reflection;
            } catch (\ReflectionException $e) {
                if ($reflectionClass = $reflectionClass->getParentClass()) {
                    return self::retrieveReflectionElement($reflectionClass, $type, $name);
                }

                throw $e;
            }
        }

        return self::$cache[$reflectionClass->getName()][$type][$name];
    }
@param \ReflectionClass $reflectionClass
@param string           $type
@param string           $name

@return \ReflectionProperty|\ReflectionMethod