From 269912c66e44f4f413ee23198434b636d86bb828 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Wed, 27 Feb 2019 15:40:35 +0900 Subject: [PATCH] Feature: Migrate to PhpParser v4 --- composer.json | 2 +- src/Node/Scalar/Boolean.php | 12 +++++++++++- src/Node/Scalar/Fake.php | 12 +++++++++++- src/Node/Scalar/Nil.php | 12 +++++++++++- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index e93968a7..30950926 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "symfony/event-dispatcher": "^3.3.6 || ^4.0", "symfony/config": "^3.3.6 || ^4.0", "symfony/yaml": "^3.3.6 || ^4.0", - "nikic/php-parser": "^3.1", + "nikic/php-parser": "^4.2.1", "phpdocumentor/reflection-docblock": "^4.3", "phpdocumentor/type-resolver": "^0.4", "webiny/event-manager": "^1.4.1", diff --git a/src/Node/Scalar/Boolean.php b/src/Node/Scalar/Boolean.php index 231e2f33..2b0a38d1 100644 --- a/src/Node/Scalar/Boolean.php +++ b/src/Node/Scalar/Boolean.php @@ -26,9 +26,19 @@ public function __construct($value, array $attributes = array()) /** * @return array */ - public function getSubNodeNames() + public function getSubNodeNames(): array { return ['value']; } //@codeCoverageIgnoreEnd + + /** + * Gets the type of the node. + * + * @return string Type of the node + */ + public function getType(): string + { + return 'Scalar_Boolean'; + } } diff --git a/src/Node/Scalar/Fake.php b/src/Node/Scalar/Fake.php index ffdf0936..6886334c 100644 --- a/src/Node/Scalar/Fake.php +++ b/src/Node/Scalar/Fake.php @@ -32,9 +32,19 @@ public function __construct($value, $type, array $attributes = array()) /** * @return array */ - public function getSubNodeNames() + public function getSubNodeNames(): array { return ['value', 'type']; } //@codeCoverageIgnoreEnd + + /** + * Gets the type of the node. + * + * @return string Type of the node + */ + public function getType(): string + { + return 'Fake'; + } } diff --git a/src/Node/Scalar/Nil.php b/src/Node/Scalar/Nil.php index ebcde2c6..a47e44bc 100644 --- a/src/Node/Scalar/Nil.php +++ b/src/Node/Scalar/Nil.php @@ -24,9 +24,19 @@ public function __construct($value = null, array $attributes = array()) /** * @return array */ - public function getSubNodeNames() + public function getSubNodeNames(): array { return ['value']; } //@codeCoverageIgnoreEnd + + /** + * Gets the type of the node. + * + * @return string Type of the node + */ + public function getType(): string + { + return 'Scalar_Nil'; + } }