You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpnamespaceX;
class A {
publicfunctionaMethod():bool {
returntrue;
}
}
functiondoFoo() {
/** @var A $x */$x = createMagically();
$x->aMethod();
}
triggers this exception
$ php vendor/bin/phpstan analyze test.php --debug -v
Note: Using configuration file C:\dvl\Workspace\dead-code-detector\phpstan.neon.dist.
C:\dvl\Workspace\dead-code-detector\test.php
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Internal error: Function createMagically not found while trying to analyse it - discovering symbols is probably not configured properly. while analysing file
C:\dvl\Workspace\dead-code-detector\test.php
Post the following stack trace to https://github.com/phpstan/phpstan/issues/new?template=Bug_report.yaml:## phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/BetterReflectionProvider.php(247)#0 phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ReflectionProvider/MemoizingReflectionProvider.php(67):PHPStan\Reflection\BetterReflection\BetterReflectionProvider->getFunction()
shipmonk-rnd/dead-code-detector#1 C:\dvl\Workspace\dead-code-detector\vendor\shipmonk\phpstan-rules\src\Rule\ForbidCheckedExceptionInCallableRule.php(430):
PHPStan\Reflection\ReflectionProvider\MemoizingReflectionProvider->getFunction()
shipmonk-rnd/dead-code-detector#2 C:\dvl\Workspace\dead-code-detector\vendor\shipmonk\phpstan-rules\src\Rule\ForbidCheckedExceptionInCallableRule.php(123):ShipMonk\PHPStan\Rule\ForbidCheckedExceptionInCallableRule->whitelistAllowedCallables()
shipmonk-rnd/dead-code-detector#3 phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/FileAnalyser.php(120):ShipMonk\PHPStan\Rule\ForbidCheckedExceptionInCallableRule->processNode()
shipmonk-rnd/dead-code-detector#4 phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(583):
PHPStan\Analyser\FileAnalyser->PHPStan\Analyser\{closure}()
shipmonk-rnd/dead-code-detector#5 phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(728):
PHPStan\Analyser\NodeScopeResolver::PHPStan\Analyser\{closure}()
shipmonk-rnd/dead-code-detector#6 phar://C:/dvl/Workspace/dead-code-detector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php(3237):
PHPStan\Analyser\NodeScopeResolver::PHPStan\Analyser\{closure}()
because ForbidCheckedExceptionInCallableRule calls $this->reflectionProvider->getFunction without a previous $this->reflectionProvider->hasFunction.
I guess similar things are possible with MethodCall, StaticCall etc.
root-cause of the problem is in shipmonk/phpstan-rules
The text was updated successfully, but these errors were encountered:
janedbal
transferred this issue from shipmonk-rnd/dead-code-detector
Sep 26, 2024
analyze a file like
triggers this exception
because
ForbidCheckedExceptionInCallableRule
calls$this->reflectionProvider->getFunction
without a previous$this->reflectionProvider->hasFunction
.I guess similar things are possible with
MethodCall
,StaticCall
etc.root-cause of the problem is in
shipmonk/phpstan-rules
The text was updated successfully, but these errors were encountered: