private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
    {
        if (!$type = $parameter->getType()) {
            return;
        }
        $name = $type->getName();
        $lcName = strtolower($name);

        if ('self' !== $lcName && 'parent' !== $lcName) {
            return $name;
        }
        if (!$function instanceof \ReflectionMethod) {
            return;
        }
        if ('self' === $lcName) {
            return $function->getDeclaringClass()->name;
        }
        if ($parent = $function->getDeclaringClass()->getParentClass()) {
            return $parent->name;
        }
    }
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
    {
        if (!$type = $parameter->getType()) {
            return;
        }
        $name = $type->getName();
        $lcName = strtolower($name);

        if ('self' !== $lcName && 'parent' !== $lcName) {
            return $name;
        }
        if (!$function instanceof \ReflectionMethod) {
            return;
        }
        if ('self' === $lcName) {
            return $function->getDeclaringClass()->name;
        }
        if ($parent = $function->getDeclaringClass()->getParentClass()) {
            return $parent->name;
        }
    }
private function getType ( \ ReflectionParameter $ parameter , \ ReflectionFunctionAbstract $ function ) { if ( ! $ type = $ parameter -> getType ( ) ) { return ; } $ name = $ type -> getName ( ) ; $ lcName = strtolower ( $ name ) ; if ( 'self' !== $ lcName && 'parent' !== $ lcName ) { return $ name ; } if ( ! $ function instanceof \ ReflectionMethod ) { return ; } if ( 'self' === $ lcName ) { return $ function -> getDeclaringClass ( ) -> name ; } if ( $ parent = $ function -> getDeclaringClass ( ) -> getParentClass ( ) ) { return $ parent -> name ; } }
Returns an associated type to the given parameter if available.

@param \ReflectionParameter $parameter

@return string|null
Returns an associated type to the given parameter if available .