Skip to content

Commit

Permalink
php-cs-fixer updated to 2.16.3 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Balčytis committed Apr 30, 2020
1 parent bab8cb0 commit 1cd98f0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion download-phar.sh
Original file line number Diff line number Diff line change
@@ -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
Binary file modified paysera-php-cs-fixer
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Fixer/PhpBasic/Comment/PhpDocContentsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)) {
Expand Down

0 comments on commit 1cd98f0

Please sign in to comment.