Skip to content

Commit 4a2d03a

Browse files
authored
Update dev-tools (#215)
1 parent c4a0108 commit 4a2d03a

File tree

8 files changed

+30
-12
lines changed

8 files changed

+30
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ script: composer test
2121
jobs:
2222
include:
2323
- stage: Static code analysis
24-
php: '7.3'
24+
php: '7.4'
2525
script:
2626
- ./check_trailing_whitespaces.sh
2727
- composer analyse

dev-tools/composer.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
{
22
"require-dev": {
3+
"ergebnis/composer-normalize": "^2.1.2",
34
"infection/infection": "^0.13.6 || ^0.14.2",
45
"johnkary/phpunit-speedtrap": "^3.1",
5-
"kubawerlos/types-checker": "^1.1",
6-
"localheinz/composer-normalize": "^1.3",
6+
"kubawerlos/types-checker": "^1.2.0",
77
"maglnet/composer-require-checker": "^2.0",
8-
"mi-schi/phpmd-extension": "^4.3",
9-
"phpmd/phpmd": "^2.7",
10-
"phpstan/phpstan": "^0.11.19",
11-
"phpstan/phpstan-strict-rules": "^0.11.1",
8+
"mi-schi/phpmd-extension": "^4.3.0",
9+
"phpmd/phpmd": "^2.8.1",
10+
"phpstan/phpstan": "^0.12.3",
11+
"phpstan/phpstan-strict-rules": "^0.12.0",
1212
"phpunit/phpunit": "^7.4 || ^8.4",
13-
"sebastian/diff": "^3.0",
14-
"squizlabs/php_codesniffer": "^3.5",
15-
"symfony/console": "^4.3",
16-
"vimeo/psalm": "^3.6",
17-
"wikimedia/composer-merge-plugin": "^1.4"
13+
"squizlabs/php_codesniffer": "^3.5.3",
14+
"vimeo/psalm": "^3.8.0",
15+
"wikimedia/composer-merge-plugin": "^1.4.1"
1816
},
1917
"extra": {
2018
"merge-plugin": {

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ parameters:
22
level: max
33
paths:
44
- ./src
5+
checkGenericClassInNonGenericObjectType: false
56
ignoreErrors:
7+
- '#^Method PhpCsFixerCustomFixers\\Fixer\\[a-zA-Z]+::configure\(\) has parameter \$configuration with no value type specified in iterable type array\.$#'
68
- '#^Parameter \#\d+ \$[a-zA-Z]+ of method PhpCsFixer\\Tokenizer\\Tokens::insertAt\(\) expects#'
79
- '#^Parameter \#\d+ \$[a-zA-Z]+ of method PhpCsFixer\\Tokenizer\\Tokens::overrideRange\(\) expects#'
810

psalm.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<InternalMethod errorLevel='suppress' />
2121
<InvalidArgument errorLevel='suppress' />
2222
<LoopInvalidation errorLevel='suppress' />
23+
<MoreSpecificReturnType>
24+
<errorLevel type='suppress'>
25+
<file name='./src/Fixers.php' />
26+
</errorLevel>
27+
</MoreSpecificReturnType>
2328
<PossiblyNullArrayAccess errorLevel='suppress' />
2429
<PossiblyNullArrayOffset errorLevel='suppress' />
2530
<PossiblyNullOperand errorLevel='suppress' />

src/Fixer/NoImportFromGlobalNamespaceFixer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ private function updateComment(Tokens $tokens, array $imports, int $index): void
124124
}
125125
}
126126

127+
/**
128+
* @param string[] $imports
129+
*/
127130
private function updateUsage(Tokens $tokens, array $imports, int $index): void
128131
{
129132
if (!\in_array($tokens[$index]->getContent(), $imports, true)) {

src/Fixer/PhpdocNoIncorrectVarAnnotationFixer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ private function isTokenCandidate(Token $token): bool
8383
return $token->isGivenKind(T_DOC_COMMENT) && \stripos($token->getContent(), '@var') !== false;
8484
}
8585

86+
/**
87+
* @param string[] $allowedVariables
88+
*/
8689
private function removeVarAnnotation(Tokens $tokens, int $index, array $allowedVariables): void
8790
{
8891
$this->removeVarAnnotationNotMatchingPattern(

src/Fixer/PhpdocNoSuperfluousParamFixer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ private function getParamNames(Tokens $tokens, int $functionIndex): array
9595
return $paramNames;
9696
}
9797

98+
/**
99+
* @param string[] $paramNames
100+
*/
98101
private function getFilteredDocComment(string $comment, array $paramNames): string
99102
{
100103
$regexParamNamesPattern = '(\Q' . \implode('\E|\Q', $paramNames) . '\E)';

src/Fixers.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
namespace PhpCsFixerCustomFixers;
66

7+
use PhpCsFixer\Fixer\FixerInterface;
78
use Symfony\Component\Finder\Finder;
89
use Symfony\Component\Finder\SplFileInfo;
910

1011
final class Fixers implements \IteratorAggregate
1112
{
13+
/**
14+
* @return \Generator<FixerInterface>
15+
*/
1216
public function getIterator(): \Generator
1317
{
1418
$finder = Finder::create()

0 commit comments

Comments
 (0)