2017 © Pedro Peláez
 

library phpdoc-reader

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

image

php-di/phpdoc-reader

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

  • Sunday, February 18, 2018
  • by mnapoli
  • Repository
  • 1 Watchers
  • 37 Stars
  • 1,455,953 Installations
  • PHP
  • 17 Dependents
  • 2 Suggesters
  • 8 Forks
  • 4 Open issues
  • 9 Versions
  • 13 % 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

18/02 2018

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

  • php >=5.4.0

 

The Development Requires

phpdoc reflection

18/02 2018

2.1.0

2.1.0.0

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

  • php >=5.4.0

 

The Development Requires

phpdoc reflection

29/11 2015

2.0.1

2.0.1.0

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

  • php >=5.3.0

 

The Development Requires

phpdoc reflection

01/06 2015

2.0.0

2.0.0.0

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

  • php >=5.3.0

 

The Development 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