private function getDocBlockFromProperty($class, $property)
    {
        // Use a ReflectionProperty instead of $class to get the parent class if applicable
        try {
            $reflectionProperty = new \ReflectionProperty($class, $property);
        } catch (\ReflectionException $reflectionException) {
            return;
        }

        $reflectionCLass = $reflectionProperty->getDeclaringClass();

        $fileReflector = $this->getFileReflector($reflectionCLass);
        if (!$fileReflector) {
            return;
        }

        foreach ($fileReflector->getClasses() as $classReflector) {
            $className = $this->getClassName($classReflector);

            if ($className === $reflectionCLass->name) {
                foreach ($classReflector->getProperties() as $propertyReflector) {
                    // strip the $ prefix
                    $propertyName = substr($propertyReflector->getName(), 1);

                    if ($propertyName === $property) {
                        return $propertyReflector->getDocBlock();
                    }
                }
            }
        }
    }
private function getDocBlockFromProperty($class, $property)
    {
        // Use a ReflectionProperty instead of $class to get the parent class if applicable
        try {
            $reflectionProperty = new \ReflectionProperty($class, $property);
        } catch (\ReflectionException $reflectionException) {
            return;
        }

        $reflectionCLass = $reflectionProperty->getDeclaringClass();

        $fileReflector = $this->getFileReflector($reflectionCLass);
        if (!$fileReflector) {
            return;
        }

        foreach ($fileReflector->getClasses() as $classReflector) {
            $className = $this->getClassName($classReflector);

            if ($className === $reflectionCLass->name) {
                foreach ($classReflector->getProperties() as $propertyReflector) {
                    // strip the $ prefix
                    $propertyName = substr($propertyReflector->getName(), 1);

                    if ($propertyName === $property) {
                        return $propertyReflector->getDocBlock();
                    }
                }
            }
        }
    }
private function getDocBlockFromProperty ( $ class , $ property ) { // Use a ReflectionProperty instead of $class to get the parent class if applicable try { $ reflectionProperty = new \ ReflectionProperty ( $ class , $ property ) ; } catch ( \ ReflectionException $ reflectionException ) { return ; } $ reflectionCLass = $ reflectionProperty -> getDeclaringClass ( ) ; $ fileReflector = $ this -> getFileReflector ( $ reflectionCLass ) ; if ( ! $ fileReflector ) { return ; } foreach ( $ fileReflector -> getClasses ( ) as $ classReflector ) { $ className = $ this -> getClassName ( $ classReflector ) ; if ( $ className === $ reflectionCLass -> name ) { foreach ( $ classReflector -> getProperties ( ) as $ propertyReflector ) { // strip the $ prefix $ propertyName = substr ( $ propertyReflector -> getName ( ) , 1 ) ; if ( $ propertyName === $ property ) { return $ propertyReflector -> getDocBlock ( ) ; } } } } }
Gets the DocBlock from a property.

@param string $class
@param string $property

@return DocBlock|null
Gets the DocBlock from a property .