From 13466286b0162aa6bace0386f30817027458b2b7 Mon Sep 17 00:00:00 2001 From: Vasil Rangelov Date: Sun, 2 Dec 2012 22:26:45 +0200 Subject: [PATCH] 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). --- composer.lock | 33 ++++++++++--------- .../Reflection/DocBlock/Type/Collection.php | 6 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/composer.lock b/composer.lock index 63bfa1c..b70f57f 100644 --- a/composer.lock +++ b/composer.lock @@ -26,6 +26,7 @@ "dflydev\\markdown": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "New BSD License" ], @@ -59,16 +60,16 @@ "packages-dev": [ { "name": "phpunit/php-code-coverage", - "version": "1.2.6", + "version": "1.2.7", "source": { "type": "git", "url": "git://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "1.2.6" + "reference": "1.2.7" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/php-code-coverage/zipball/1.2.6", - "reference": "1.2.6", + "url": "https://github.com/sebastianbergmann/php-code-coverage/archive/1.2.7.zip", + "reference": "1.2.7", "shasum": "" }, "require": { @@ -81,7 +82,7 @@ "ext-dom": "*", "ext-xdebug": ">=2.0.5" }, - "time": "2012-10-16 22:34:13", + "time": "2012-12-02 14:54:55", "type": "library", "installation-source": "dist", "autoload": { @@ -295,16 +296,16 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.9", + "version": "3.7.10", "source": { "type": "git", "url": "git://github.com/sebastianbergmann/phpunit.git", - "reference": "3.7.9" + "reference": "3.7.10" }, "dist": { "type": "zip", - "url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.9.zip", - "reference": "3.7.9", + "url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.10.zip", + "reference": "3.7.10", "shasum": "" }, "require": { @@ -313,7 +314,7 @@ "phpunit/php-text-template": ">=1.1.1", "phpunit/php-code-coverage": ">=1.2.1", "phpunit/php-timer": ">=1.0.2", - "phpunit/phpunit-mock-objects": ">=1.2.0", + "phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0", "symfony/yaml": ">=2.1.0", "ext-dom": "*", "ext-pcre": "*", @@ -326,7 +327,7 @@ "ext-simplexml": "*", "ext-tokenizer": "*" }, - "time": "2012-11-06 19:49:38", + "time": "2012-12-02 14:56:55", "bin": [ "composer/bin/phpunit" ], @@ -417,23 +418,23 @@ }, { "name": "symfony/yaml", - "version": "v2.1.3", + "version": "v2.1.4", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml", - "reference": "v2.1.3" + "reference": "v2.1.4" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Yaml/zipball/v2.1.3", - "reference": "v2.1.3", + "url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip", + "reference": "v2.1.4", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2012-10-29 04:15:41", + "time": "2012-11-08 09:51:48", "type": "library", "extra": { "branch-alias": { diff --git a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php index 19e7603..90ead3f 100644 --- a/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php +++ b/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php @@ -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); } /**