mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 10:07:12 +00:00
Added "scalar" as a recognized keyword (phpDocumentor/phpDocumentor2#694);
Changed the list of keywords to be static (for the purpose of reducing memory consumption); Updated composer.lock with the latest dependencies (PHPUnit in particular).
This commit is contained in:
@@ -34,9 +34,9 @@ class Collection extends \ArrayObject
|
||||
const OPERATOR_NAMESPACE = '\\';
|
||||
|
||||
/** @var string[] List of recognized keywords */
|
||||
protected $keywords = array(
|
||||
protected static $keywords = array(
|
||||
'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double',
|
||||
'object', 'mixed', 'array', 'resource', 'void', 'null',
|
||||
'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar',
|
||||
'callback', 'callable', 'false', 'true', 'self', '$this', 'static'
|
||||
);
|
||||
|
||||
@@ -199,7 +199,7 @@ class Collection extends \ArrayObject
|
||||
*/
|
||||
protected function isTypeAKeyword($type)
|
||||
{
|
||||
return in_array(strtolower($type), $this->keywords, true);
|
||||
return in_array(strtolower($type), static::$keywords, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user