New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class […] not found and could not be autoloaded #576
Comments
Hi, thanks for the report. I will investigate this because it looks like the autoloading isn't necessary, the nonexistent class is not in your code. |
Thank you 👍 |
Necessary to run phpstan. Can be removed once phpstan/phpstan#576 has been fixed.
I see what the problem is now: namespace Symfony\Component\DependencyInjection;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
class ExpressionLanguage extends BaseExpressionLanguage
{
//...
} Autoloader is asked whether The reason why PHPStan is even interested in this class is because it creates all property reflections of a class when it's first loaded. I could remedy this problem by moving to a more lazy creation but I'm afraid of performance implications. I might try that soon but I'm not sure about the results. |
I realized that this problem does not longer exist on I added a test: acaac52 and made sure it fails on 0.8.5. |
Oh god, I realized that the issue is still here but you have to construct a different phpDoc in order to surface it. |
Reproduced here: #601 |
Fixed for real: 8055761 |
Thank you very much for your effort 👍 |
Hey,
I've added phpstan to a package which has some dependencies to symfony, especially
symfony/dependency-injection: ~3.3
.It does not depend on
symfony/expression-language
and does not use any class from there,but the
symfony/expression-language
is an optional dependency forsymfony/dependency-injection
.Short:
symfony/dependency-injection
is installed and used,symfony/expression-language
not.When I run phpstan I get
(see Travis Build)
It looks like its analyzing the
Symfony\Component\DependencyInjection\ContainerBuilder
and fails aboutAnything I can do to avoid this error besides requiring
symfony/expression-language
as dev-dependency?The text was updated successfully, but these errors were encountered: