Skip to content
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

Fallback to default helper set when no application loader is provided #310

Open
wants to merge 1 commit into
base: 1.2.x
Choose a base branch
from

Conversation

acrobat
Copy link

@acrobat acrobat commented Nov 12, 2022

I'm using the phpstan-symfony extension in a library so I'm not able to register the standard console application loader (as you would in a regular project)

So I've added a fallback to the default helper set symfony will register during setup of the console application.

See: https://github.com/symfony/symfony/blob/ea9ed6c821f76dfc5cf0639ebd1a23db971dc6e4/src/Symfony/Component/Console/Application.php#L1096-L1107

Most of the getHelper cases can be handled by this default set. When someone has custom helpers they should use the consoleApplicationLoader option.

@acrobat acrobat force-pushed the improve-gethelper-type branch from cc796d4 to 52ad6de Compare November 12, 2022 18:45
@ondrejmirtes
Copy link
Member

Please explain what effect does this have on real-world applications, thanks.

I'm using the phpstan-symfony extension in a library

You can still create a Console Application just for the purpose of static analysis with PHPStan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants