hartmann/magic-property-extractor

Provides property information based on class documentation


Keywords
symfony, phpdoc, type, extractor, property, property-info
License
MIT

Documentation

magic-property-extractor

This package adds an additional extractor for the symfony/property-info package which is able to interpret @property, @property-read and @property-write tags documented in the DocComment of a class.

Installation

composer require hartmann/magic-property-extractor

Usage

use Hartmann\PropertyInfo\Extractor\PhpDocMagicExtractor

$magicExtractor = new PhpDocMagicExtractor();
$properties = $magicExtractor->getProperties(\Foo::class);

or create a new PropertyInfoExtractor instance and provide it with a set of information extractors

Extractable Information

This Extractor implements the following interfaces:

  • PropertyDescriptionExtractorInterface
  • PropertyTypeExtractorInterface
  • PropertyAccessExtractorInterface
  • PropertyListExtractorInterface

Planned features

  • Support magic accessors and mutators