2017 © Pedro Peláez
 

library phpdocreader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

image

mnapoli/phpdocreader

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

  • Sunday, April 26, 2015
  • by mnapoli
  • Repository
  • 0 Watchers
  • 0 Stars
  • 239,488 Installations
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

PhpDocReader

CI, (*1)

This project is used by:, (*2)

Fork the README to add your project here., (*3)

Features

PhpDocReader parses @var and @param values in PHP docblocks:, (*4)


use My\Cache\Backend; class Cache { /** * @var Backend */ protected $backend; /** * @param Backend $backend */ public function __construct($backend) { } }

It supports namespaced class names with the same resolution rules as PHP:, (*5)

  • fully qualified name (starting with \)
  • imported class name (eg. use My\Cache\Backend;)
  • relative class name (from the current namespace, like SubNamespace\MyClass)
  • aliased class name (eg. use My\Cache\Backend as FooBar;)

Primitive types (@var string) are ignored (returns null), only valid class names are returned., (*6)

Usage

$reader = new PhpDocReader();

// Read a property type (@var phpdoc)
$property = new ReflectionProperty($className, $propertyName);
$propertyClass = $reader->getPropertyClass($property);

// Read a parameter type (@param phpdoc)
$parameter = new ReflectionParameter([$className, $methodName], $parameterName);
$parameterClass = $reader->getParameterClass($parameter);

The Versions

26/04 2015

dev-master

9999999-dev

PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)

  Sources   Download

MIT

The Requires

 

phpdoc reflection

21/08 2014

1.3.0

1.3.0.0

  Sources   Download

MIT

The Requires

 

phpdoc reflection

28/01 2014

1.2.1

1.2.1.0

  Sources   Download

MIT

The Requires

 

phpdoc reflection

28/01 2014

1.2.0

1.2.0.0

  Sources   Download

MIT

The Requires

 

phpdoc reflection

15/12 2013

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

 

phpdoc reflection

15/10 2013

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

phpdoc reflection