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
It's possible to configure a `objectManagerLoader` that returns an instance to your configured Doctrine manager.
This works great, and it gives PHPStan super capabilities.
In most cases, you would fetch this object manager from the container from your framework (e.g. Symfony).
But that requires the Symfony container to be compiled and booted.
All good, unless you make a typo in one of your service configurations.
You're left with an internal error when running PHPStan:
```
<unknown location> Internal error: You have requested a non-existent service "some_service".
while analysing file /Volumes/CS/www/src/SomeFile.php
Run PHPStan with -v option and post the stack trace to:
https://github.com/phpstan/phpstan/issues/new?template=Bug_report.yaml
Found 1 error
⚠️ Result is incomplete because of severe errors. ⚠️
Fix these errors first and then re-run PHPStan
to get all reported errors.
``
Making mistakes is a common thing we do, so having PHPStan crash like this is counter productive.
Even worse, when using the PHPStan integration in PHPStorm, you get error popups every time that this happened.
Since the `objectManagerLoader` is already optional, we can improve things by catching Throwable's that occur while
including the `objectManagerLoader` file and then we return `null`.
To make it easier to debug this problem later, in the diagnostic extension, we show the last error that occurred.
0 commit comments