From c4ad66b76e4c22f61937e349ef968e282e5fa661 Mon Sep 17 00:00:00 2001 From: dumith-eranga Date: Wed, 16 Nov 2016 14:36:20 +0530 Subject: [PATCH 1/2] Support for constants with PHP short array syntax Added support for constants with PHP short array syntax. Applicable for PHP 5.6 and above. --- TokenReflection/ReflectionConstant.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TokenReflection/ReflectionConstant.php b/TokenReflection/ReflectionConstant.php index 4dc39672..71867649 100644 --- a/TokenReflection/ReflectionConstant.php +++ b/TokenReflection/ReflectionConstant.php @@ -358,6 +358,12 @@ private function parseValue(Stream $tokenStream, IReflection $parent) T_NS_C => true, T_TRAIT_C => true ); + + if ( floatval(phpversion()) >= 5.6 ) { + $acceptedTokens['['] = true; + $acceptedTokens[']'] = true; + $acceptedTokens[T_DOUBLE_ARROW] = true; + } while (null !== ($type = $tokenStream->getType())) { if (T_START_HEREDOC === $type) { From 56ab8e3f4b75ee558c80931438a13fb79fcecd31 Mon Sep 17 00:00:00 2001 From: dumith-eranga Date: Mon, 19 Dec 2016 11:04:38 +0530 Subject: [PATCH 2/2] replace "andrewsville/php-token-reflection" --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1569e612..63a2e6b2 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,11 @@ "homepage": "https://github.com/kukulich" } ], - + + "replace": { + "andrewsville/php-token-reflection": "1.*" + }, + "require": { "php": ">=5.3.0", "ext-tokenizer": "*"