mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Handle more PHPDoc type keyworks (#23)
* Added advanced PHPDoc type keyworks * Fixed typed keywords
This commit is contained in:
@@ -37,7 +37,14 @@ class Collection extends \ArrayObject
|
||||
protected static $keywords = array(
|
||||
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
|
||||
'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
|
||||
'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
|
||||
'callback', 'callable', 'false', 'true', 'self', '$this', 'static',
|
||||
'array-key', 'number', 'iterable', 'pure-callable', 'closed-resource',
|
||||
'open-resource', 'positive-int', 'negative-int', 'non-positive-int',
|
||||
'non-negative-int', 'non-zero-int', 'non-empty-array', 'list',
|
||||
'non-empty-list', 'key-of', 'value-of', 'template-type', 'class-string',
|
||||
'callable-string', 'numeric-string', 'non-empty-string',
|
||||
'non-falsy-string', 'literal-string', 'lowercase-string', 'never',
|
||||
'never-return', 'never-returns', 'no-return', 'int-mask', 'int-mask-of'
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -194,7 +201,7 @@ class Collection extends \ArrayObject
|
||||
return '';
|
||||
}
|
||||
|
||||
if (substr($type, 0, 6) === 'array<' && substr($type, -1) === '>') {
|
||||
if (preg_match('/^[\w-]+<.*>$/', $type)) {
|
||||
return $type;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user