Fix fatal error when configuring a PHP-CS-Fixer fixer - #62
Merged
Conversation
|
I have exactly the same issue with the same file |
TomasVotruba
force-pushed
the
reproduce-configured-fixer-fatal
branch
from
August 24, 2026 14:42
c599c7a to
2e7d2e5
Compare
Ship a declaration-only Symfony console Application stub so configured php-cs-fixer fixers do not fatal, plus a CI reproducer for issue #44.
phpstan 2.2.9 infers the return type correctly, so the ignore pattern is never matched and reportUnmatched fails the run.
TomasVotruba
force-pushed
the
reproduce-configured-fixer-fatal
branch
from
August 24, 2026 16:57
2905f9a to
3216285
Compare
TomasVotruba
enabled auto-merge (squash)
August 24, 2026 16:58
Member
Author
|
Just released https://github.com/ecsphp/ecs/releases/tag/13.2.19 Can you verify this works for you? |
|
Yes, it works for me, thanks! |
Member
Author
|
Awesome :) great to hear that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44.
Cause
ECS
replacessymfony/console, soSymfony\Component\Console\Applicationis never installed.Configuring a php-cs-fixer fixer with a deprecated option runs
ConfigurableFixerTrait::configure(), which callsPhpCsFixer\Console\Application::getMajorVersion(). That class extends the missing SymfonyApplication, so PHP fatals resolving the parent:Fix
Ship a declaration-only stub in
/stubs, autoloaded via classmap. ECS never runs the php-cs-fixer console, so only the class declaration is needed. php-scoper prefixes the stub with everything else, so the release build gets the prefixed name php-cs-fixer'sApplicationextends there.stubsis added to the downgrade and scoping build steps.CI
New
Configured Fixerworkflow runsbin/ecs checkwith a configured fixer and asserts output instead of a fatal.before:
after: