update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
57
www/analytics/vendor/mnapoli/phpdocreader/README.md
vendored
Normal file
57
www/analytics/vendor/mnapoli/phpdocreader/README.md
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# PhpDocReader
|
||||
|
||||
[](https://travis-ci.org/mnapoli/PhpDocReader) [](https://coveralls.io/r/mnapoli/PhpDocReader)
|
||||
|
||||
This project is used by:
|
||||
|
||||
- [PHP-DI](http://php-di.org/)
|
||||
- [phockito-unit-php-di](https://github.com/balihoo/phockito-unit-php-di)
|
||||
|
||||
Fork the README to add your project here.
|
||||
|
||||
## Features
|
||||
|
||||
PhpDocReader parses `@var` and `@param` values in PHP docblocks:
|
||||
|
||||
```php
|
||||
|
||||
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:
|
||||
|
||||
- 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.
|
||||
|
||||
## Usage
|
||||
|
||||
```php
|
||||
$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(array($className, $methodName), $parameterName);
|
||||
$parameterClass = $reader->getParameterClass($parameter);
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue