File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3
3
[ ![ Build Status] ( https://travis-ci.org/mnapoli/PhpDocReader.png?branch=master )] ( https://travis-ci.org/mnapoli/PhpDocReader ) [ ![ Coverage Status] ( https://coveralls.io/repos/mnapoli/PhpDocReader/badge.png )] ( https://coveralls.io/r/mnapoli/PhpDocReader )
4
4
5
5
This project is a sub-project of [ PHP-DI] ( http://mnapoli.github.io/PHP-DI/ ) .
6
+
7
+ ## Usage
8
+
9
+ ``` php
10
+ $reader = new PhpDocReader();
11
+
12
+ // Read a property type (@var phpdoc)
13
+ $property = new ReflectionProperty($className, $propertyName);
14
+ $propertyType = $reader->getPropertyType($property);
15
+
16
+ // Read a parameter type (@param phpdoc)
17
+ $parameter = new ReflectionParameter(array($className, $methodName), $parameterName);
18
+ $parameterType = $reader->getParameterType($parameter);
19
+ ```
You can’t perform that action at this time.
0 commit comments