Skip to content

Commit 0f286bb

Browse files
petrparolekf3l1x
authored andcommitted
upgrade PHPStan
1 parent 6e80ce7 commit 0f286bb

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ csf:
1616
vendor/bin/codefixer src tests
1717

1818
phpstan:
19-
vendor/bin/phpstan analyse -l max -c phpstan.neon src
19+
vendor/bin/phpstan analyse -l 8 -c phpstan.neon src
2020

2121
tests:
2222
vendor/bin/codecept build

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"nette/application": "^3.0",
3333
"nette/caching": "~2.5.8 || ^3.0",
3434
"ninjify/qa": "^0.12",
35-
"phpstan/phpstan": "^0.12",
36-
"phpstan/phpstan-deprecation-rules": "^0.12",
37-
"phpstan/phpstan-nette": "^0.12",
38-
"phpstan/phpstan-strict-rules": "^0.12",
35+
"phpstan/phpstan": "^1.0",
36+
"phpstan/phpstan-deprecation-rules": "^1.0",
37+
"phpstan/phpstan-nette": "^1.0",
38+
"phpstan/phpstan-strict-rules": "^1.0",
3939
"tracy/tracy": "~2.6.1 || ~2.7.0"
4040
},
4141
"conflict": {

phpstan.neon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ includes:
66
- extension.neon
77

88
parameters:
9-
excludes_analyse:
9+
excludePaths:
1010
- %currentWorkingDirectory%/tests/_*
1111

1212
ignoreErrors:
1313
- '#^Only booleans are allowed in a negated boolean, string\|null given.#'
1414
- '#(.+)should be contravariant(.+)#'
1515

16+
- '#^Property Contributte\\Codeception\\Module\\NetteApplicationModule::\$path is never read, only written.#'
17+
1618
# Should not happen
1719
- '#^Method Contributte\\Codeception\\Module\\NetteDIModule::getContainer\(\) should return Nette\\DI\\Container but returns Nette\\DI\\Container\|null#'
1820
- '#^Method Contributte\\Codeception\\Http\\Request::getFile\(\) should return Nette\\Http\\FileUpload\|null but returns array\|Nette\\Http\\FileUpload\|null.#'
@@ -28,3 +30,4 @@ parameters:
2830
Codeception\Module:
2931
- fail
3032

33+
reportMaybesInPropertyPhpDocTypes: false

src/Module/NetteDIModule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function getContainer(): Container
111111
public function grabService(string $service)
112112
{
113113
try {
114+
/** @phpstan-var class-string $service */
114115
return $this->getContainer()->getByType($service);
115116
} catch (MissingServiceException $e) {
116117
$this->fail($e->getMessage());

src/Qa/PhpStan/NetteDIModuleType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
3131
return $methodReflection->getReturnType();
3232
}
3333

34-
$arg = $methodCall->args[0]->value;
34+
$arg = $methodCall->getArgs()[0]->value;
3535

3636
if (!$arg instanceof ClassConstFetch) {
3737
return $methodReflection->getReturnType();

0 commit comments

Comments
 (0)