From 8f4aa3ecaab636271c22f6819bf7e3894422de8a Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 21 Oct 2020 15:32:52 +0200 Subject: [PATCH 1/2] Travis > Test on PHP 7.4 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 8d81424a..3c1c6eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4 before_script: - composer install script: From 466896d9276c28911a64725b23729e6401fbc6af Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 21 Oct 2020 15:33:02 +0200 Subject: [PATCH 2/2] Updated coding standard that can run on PHP 7.4 --- composer.json | 4 ++-- phpcs.xml | 16 ++++++++++++++-- .../DisallowedImplicitArrayCreationRule.php | 4 +++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 3a9309db..3250bcc6 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ "phpstan/phpstan": "^0.12.33" }, "require-dev": { - "consistence/coding-standard": "^3.0.1", + "consistence/coding-standard": "^3.10", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "ergebnis/composer-normalize": "^2.0.2", "phing/phing": "^2.16.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-phpunit": "^0.12", "phpunit/phpunit": "^7.0", - "slevomat/coding-standard": "^4.5.2" + "slevomat/coding-standard": "^6.4" }, "config": { "sort-packages": true diff --git a/phpcs.xml b/phpcs.xml index 738b1aec..969e0543 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -17,7 +17,7 @@ - + + + + + + + + + + + + + - + diff --git a/src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php b/src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php index f5f53dca..4aa7c1c4 100644 --- a/src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php +++ b/src/Rules/DisallowedConstructs/DisallowedImplicitArrayCreationRule.php @@ -41,7 +41,9 @@ public function processNode(\PhpParser\Node $node, Scope $scope): array return [ sprintf('Implicit array creation is not allowed - variable $%s does not exist.', $node->name), ]; - } elseif ($certainty->maybe()) { + } + + if ($certainty->maybe()) { return [ sprintf('Implicit array creation is not allowed - variable $%s might not exist.', $node->name), ];