diff --git a/CHANGELOG.md b/CHANGELOG.md index b8ece62..94b5f99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ Semantic Versioning is maintained only for the following: The fixers themselves can change their behavior on any update. New fixers could be added with minor releases, this would require changes in configuration if migration mode is used. +## 2.3.0 + +### Changed + +- `php-cs-fixer` is updated to `2.16.3` version, including binary `paysera-php-cs-fixer` that's distributed with this +library. + ## 2.2.3 ### Removed diff --git a/composer.json b/composer.json index 9ec9b44..ce28838 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "require-dev": { "gecko-packages/gecko-php-unit": "^2.0", "phpunit/phpunit": "^6.0", - "friendsofphp/php-cs-fixer": "2.14.2" + "friendsofphp/php-cs-fixer": "2.16.3" }, "autoload": { "psr-4": { @@ -30,9 +30,11 @@ "bin-dir": "bin" }, "scripts" : { - "download-phar": [ - "./download-phar.sh" - ] + "download-phar": "./download-phar.sh", + "phpunit": "phpunit", + "fix-cs": "./paysera-php-cs-fixer fix", + "test-cs": "./paysera-php-cs-fixer fix --dry-run -v", + "test": ["@phpunit", "@test-cs"] }, "bin": [ "paysera-php-cs-fixer" diff --git a/download-phar.sh b/download-phar.sh index 59f2802..797630a 100755 --- a/download-phar.sh +++ b/download-phar.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.14.2/php-cs-fixer.phar -o paysera-php-cs-fixer +curl -L https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.3/php-cs-fixer.phar -o paysera-php-cs-fixer chmod +x paysera-php-cs-fixer diff --git a/paysera-php-cs-fixer b/paysera-php-cs-fixer index 7eb7d16..c61bd90 100755 Binary files a/paysera-php-cs-fixer and b/paysera-php-cs-fixer differ diff --git a/src/Fixer/PhpBasic/Comment/PhpDocContentsFixer.php b/src/Fixer/PhpBasic/Comment/PhpDocContentsFixer.php index 9d1ee9a..39af5a7 100644 --- a/src/Fixer/PhpBasic/Comment/PhpDocContentsFixer.php +++ b/src/Fixer/PhpBasic/Comment/PhpDocContentsFixer.php @@ -140,7 +140,7 @@ private function validateDocBlockParameters( // Collect parameters for ($i = $parenthesesStartIndex; $i < $parenthesesEndIndex; $i++) { if ($tokens[$i]->isGivenKind(T_VARIABLE)) { - $parameter = null; + $parameter = []; $previousTokenIndex = $tokens->getPrevMeaningfulToken($i); if ($tokens[$previousTokenIndex]->isGivenKind(T_STRING)) { $index = $previousTokenIndex; @@ -149,7 +149,7 @@ private function validateDocBlockParameters( && !$tokens[$index]->equals(',') && !$tokens[$index]->isWhitespace() ) { - $parameter['Typecast'] = $tokens[$index]->getContent() . $parameter['Typecast']; + $parameter['Typecast'] = $tokens[$index]->getContent() . ($parameter['Typecast'] ?? ''); $index--; } } elseif (in_array($tokens[$previousTokenIndex]->getContent(), $this->scalarTypes, true)) {