public static function fromProperty(
        string $class,
        string $property
    ): array
    {
        try {

            $property = new \ReflectionProperty($class, $property);
        }
        catch (\ReflectionException $e) {

            throw new Exception(
                "Property '{$class}::{$property}' not found.",
                Exception::PROPERTY_NOT_FOUND
            );
        }

        $docComment = $property->getDocComment();

        unset($property);

        if ($docComment === false) {

            return [];
        }

        return Parser::parseDocComment($docComment);
    }
public static function fromProperty(
        string $class,
        string $property
    ): array
    {
        try {

            $property = new \ReflectionProperty($class, $property);
        }
        catch (\ReflectionException $e) {

            throw new Exception(
                "Property '{$class}::{$property}' not found.",
                Exception::PROPERTY_NOT_FOUND
            );
        }

        $docComment = $property->getDocComment();

        unset($property);

        if ($docComment === false) {

            return [];
        }

        return Parser::parseDocComment($docComment);
    }
public static function fromProperty ( string $ class , string $ property ) : array { try { $ property = new \ ReflectionProperty ( $ class , $ property ) ; } catch ( \ ReflectionException $ e ) { throw new Exception ( "Property '{$class}::{$property}' not found." , Exception :: PROPERTY_NOT_FOUND ) ; } $ docComment = $ property -> getDocComment ( ) ; unset ( $ property ) ; if ( $ docComment === false ) { return [ ] ; } return Parser :: parseDocComment ( $ docComment ) ; }
Extract the annotations from a property.

@param string $class
@param string $property

@throws \L\Annotation\Exception

@return array
Extract the annotations from a property .