protected function getPluginAnnotationProperties($pluginAnnotationClass)
    {
        // Get a reflection class for the annotation class.
        // Each property of the annotation class describes a property for the
        // plugin annotation.
        $annotationReflection = new \ReflectionClass($pluginAnnotationClass);
        $propertiesReflection = $annotationReflection->getProperties(\ReflectionProperty::IS_PUBLIC);

        $pluginProperties = [];
        $annotationPropertyMetadata = [];

        foreach ($propertiesReflection as $propertyReflection) {
            $annotationPropertyMetadata['name'] = $propertyReflection->name;

            $propertyDocblock = $propertyReflection->getDocComment();
            $propertyDocblockLines = explode("\n", $propertyDocblock);
            foreach ($propertyDocblockLines as $line) {
                if (substr($line, 0, 3) == '/**') {
                    continue;
                }

                // Take the first actual docblock line to be the description.
                if (!isset($annotationPropertyMetadata['description']) && substr($line, 0, 5) == '   * ') {
                    $annotationPropertyMetadata['description'] = substr($line, 5);
                }

                // Look for a @var token, to tell us the type of the property.
                if (substr($line, 0, 10) == '   * @var ') {
                    $annotationPropertyMetadata['type'] = substr($line, 10);
                }
            }

            $pluginProperties[$propertyReflection->name] = $annotationPropertyMetadata;
        }

        return $pluginProperties;
    }
protected function getPluginAnnotationProperties($pluginAnnotationClass)
    {
        // Get a reflection class for the annotation class.
        // Each property of the annotation class describes a property for the
        // plugin annotation.
        $annotationReflection = new \ReflectionClass($pluginAnnotationClass);
        $propertiesReflection = $annotationReflection->getProperties(\ReflectionProperty::IS_PUBLIC);

        $pluginProperties = [];
        $annotationPropertyMetadata = [];

        foreach ($propertiesReflection as $propertyReflection) {
            $annotationPropertyMetadata['name'] = $propertyReflection->name;

            $propertyDocblock = $propertyReflection->getDocComment();
            $propertyDocblockLines = explode("\n", $propertyDocblock);
            foreach ($propertyDocblockLines as $line) {
                if (substr($line, 0, 3) == '/**') {
                    continue;
                }

                // Take the first actual docblock line to be the description.
                if (!isset($annotationPropertyMetadata['description']) && substr($line, 0, 5) == '   * ') {
                    $annotationPropertyMetadata['description'] = substr($line, 5);
                }

                // Look for a @var token, to tell us the type of the property.
                if (substr($line, 0, 10) == '   * @var ') {
                    $annotationPropertyMetadata['type'] = substr($line, 10);
                }
            }

            $pluginProperties[$propertyReflection->name] = $annotationPropertyMetadata;
        }

        return $pluginProperties;
    }
protected function getPluginAnnotationProperties ( $ pluginAnnotationClass ) { // Get a reflection class for the annotation class. // Each property of the annotation class describes a property for the // plugin annotation. $ annotationReflection = new \ ReflectionClass ( $ pluginAnnotationClass ) ; $ propertiesReflection = $ annotationReflection -> getProperties ( \ ReflectionProperty :: IS_PUBLIC ) ; $ pluginProperties = [ ] ; $ annotationPropertyMetadata = [ ] ; foreach ( $ propertiesReflection as $ propertyReflection ) { $ annotationPropertyMetadata [ 'name' ] = $ propertyReflection -> name ; $ propertyDocblock = $ propertyReflection -> getDocComment ( ) ; $ propertyDocblockLines = explode ( "\n" , $ propertyDocblock ) ; foreach ( $ propertyDocblockLines as $ line ) { if ( substr ( $ line , 0 , 3 ) == '/**' ) { continue ; } // Take the first actual docblock line to be the description. if ( ! isset ( $ annotationPropertyMetadata [ 'description' ] ) && substr ( $ line , 0 , 5 ) == '   * ' ) { $ annotationPropertyMetadata [ 'description' ] = substr ( $ line , 5 ) ; } // Look for a @var token, to tell us the type of the property. if ( substr ( $ line , 0 , 10 ) == '   * @var ' ) { $ annotationPropertyMetadata [ 'type' ] = substr ( $ line , 10 ) ; } } $ pluginProperties [ $ propertyReflection -> name ] = $ annotationPropertyMetadata ; } return $ pluginProperties ; }
Get the list of properties from an annotation class.

@param $pluginAnnotationClass
The fully-qualified name of the plugin annotation class.

@return
An array keyed by property name, where each value is an array containing:
- 'name: The name of the property.
- 'description': The description from the property's docblock first line.
Get the list of properties from an annotation class .