PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 3.0.1
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v3.0.1
4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.5 3.6.6 3.7.0 3.7.1 3.8.0 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.2.0 4.2.1 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.10 4.3.11 4.3.12 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.7.1 4.3.8 4.3.9 4.3.9.1 4.4.0 4.4.1 4.4.2 4.5.0 4.5.1 4.5.10 4.5.11 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.7.0
cookiebot / addons / lib / ioc / php-di / phpdoc-reader / README.md
cookiebot / addons / lib / ioc / php-di / phpdoc-reader Last commit date
src 7 years ago .gitattributes 7 years ago .gitignore 7 years ago LICENSE 7 years ago README.md 7 years ago composer.json 7 years ago
README.md
59 lines
1 # PhpDocReader
2
3 [](https://travis-ci.org/mnapoli/PhpDocReader![Build Status](https://img.shields.io/travis/PHP-DI/PhpDocReader.svg)](https://travis-ci.org/mnapoli/PhpDocReader](https://travis-ci.org/mnapoli/PhpDocReader)
4 ![](https://img.shields.io/packagist/dt/PHP-DI/phpdoc-reader.svg)
5
6 This project is used by:
7
8 - [](http://php-di.org/PHP-DI](http://php-di.org/](http://php-di.org/)
9 - [](https://github.com/balihoo/phockito-unit-php-diphockito-unit-php-di](https://github.com/balihoo/phockito-unit-php-di](https://github.com/balihoo/phockito-unit-php-di)
10
11 Fork the README to add your project here.
12
13 ## Features
14
15 PhpDocReader parses `@var` and `@param` values in PHP docblocks:
16
17 ```php
18
19 use My\Cache\Backend;
20
21 class Cache
22 {
23 /**
24 * @var Backend
25 */
26 protected $backend;
27
28 /**
29 * @param Backend $backend
30 */
31 public function __construct($backend)
32 {
33 }
34 }
35 ```
36
37 It supports namespaced class names with the same resolution rules as PHP:
38
39 - fully qualified name (starting with `\`)
40 - imported class name (eg. `use My\Cache\Backend;`)
41 - relative class name (from the current namespace, like `SubNamespace\MyClass`)
42 - aliased class name (eg. `use My\Cache\Backend as FooBar;`)
43
44 Primitive types (`@var string`) are ignored (returns null), only valid class names are returned.
45
46 ## Usage
47
48 ```php
49 $reader = new PhpDocReader();
50
51 // Read a property type (@var phpdoc)
52 $property = new ReflectionProperty($className, $propertyName);
53 $propertyClass = $reader->getPropertyClass($property);
54
55 // Read a parameter type (@param phpdoc)
56 $parameter = new ReflectionParameter(array($className, $methodName), $parameterName);
57 $parameterClass = $reader->getParameterClass($parameter);
58 ```
59