1.2.1 2020-10-16 03:08 UTC


Extensions for the Symfony property-info component.

  • Magic class method extractor DocBlockMagicExtractor
  • Support for merging results of multiple extractors where possible

Build Status Coverage Status License: MIT



You can use Composer or simply Download the Release


The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

composer require radebatz/property-info-extras



use Radebatz\PropertyInfoExtras\Extractor\DocBlockCache;
use Radebatz\PropertyInfoExtras\Extractor\DocBlockMagicExtractor;

 * @method string getProString()
 * @method void setProString(?string $proString)
class MagicPopo {
    protected $properties = [];

    public function __call($method, $args)
        $name = lcfirst(substr($method, 3));

        if (0 == count($args)) {
            if (0 === strpos($method, 'get')) {
                return array_key_exists($name, $this->properties) ? $this->properties[$name] : null;
        } elseif (1 == count($args)) {
            if (0 === strpos($method, 'set')) {
                $this->properties[$name] = $args[0];


        throw new \RuntimeException(sprintf('Invalid method on: %s: method: "%s"', get_class($this), $method));

$phpDocMagicExtractor = new DocBlockMagicExtractor(new DocBlockCache());
$properties = $phpDocMagicExtractor->getProperties(MagicPopo::class);
// ['proString']


Same as documented in The PropertyInfo Component expect that Radebatz\PropertyInfoExtras\PropertyInfoExtraExtractor provides the following additional xxAllxxx() methods:

  • getAllProperties()

    Total of properties reported. Order of extractors is relevant (last one wins).

  • getAllTypes()

    Total of types reported. Merging is done on property level only in cases where later extractors add to the already extracted info (first one wins).

  • isAllReadable()

    true if at least one extractor returns true.

  • isAllWritable()

    true if at least one extractor returns true.