Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
fallback to last working phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 28, 2021
1 parent b93c8bf commit 6f39bb8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ocramius/package-versions": "^1.4",
"phar-io/version": "^3.0.3",
"phpstan/phpdoc-parser": "^0.4.9",
"phpstan/phpstan": "^0.12.64",
"phpstan/phpstan": "^0.12.64, <0.12.70",
"phpunit/phpunit": "^9.5",
"psr/simple-cache": "^1.0",
"sebastian/diff": "^3.0|^4.0",
Expand Down Expand Up @@ -65,8 +65,7 @@
"symfony/security-core": "^4.4|^5.1",
"symfony/templating": "^4.4|^5.1",
"symfony/translation": "^4.4|^5.1",
"symfony/twig-bundle": "^4.4|^5.1",
"tracy/tracy": "^2.8.1"
"symfony/twig-bundle": "^4.4|^5.1"
},
"autoload": {
"files": [
Expand Down
8 changes: 7 additions & 1 deletion packages/phpstan-rules/src/ParentClassMethodNodeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PhpParser\Parser;
use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use ReflectionMethod;
use Symplify\SmartFileSystem\SmartFileSystem;
use Throwable;

Expand Down Expand Up @@ -48,7 +49,12 @@ public function resolveParentClassMethodNodes(Scope $scope, string $methodName):
/** @var ClassReflection[] $parentClassReflections */
$parentClassReflections = $this->getParentClassReflections($scope);
foreach ($parentClassReflections as $parentClassReflection) {
$fileName = $parentClassReflection->getFileName();
if (! $parentClassReflection->hasMethod($methodName)) {
continue;
}

$parentMethodReflection = new ReflectionMethod($parentClassReflection->getName(), $methodName);
$fileName = $parentMethodReflection->getFileName();
if ($fileName === false) {
continue;
}
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- packages/phpstan-extensions/config/config.neon
- packages/phpstan-rules/config/symplify-rules.neon
# for cognitive rules
Expand Down

0 comments on commit 6f39bb8

Please sign in to comment.