Skip to content

The lint:twig command should collect all deprecations of a template and not just the first one #59961

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

Closed
stof opened this issue Mar 12, 2025 · 0 comments · Fixed by #60039
Closed
Labels
Feature Good first issue Ideal for your first contribution! (some Symfony experience may be required) TwigBridge

Comments

@stof
Copy link
Member

stof commented Mar 12, 2025

Description

The current implementation of the lint:twig command in symfony/twig-bridge turns deprecations into an Error that is caught. The effect of this is that only the first deprecation of a template is reported (as this ends parsing).
The \Twig\Util\DeprecationCollector is implemented in a different way where the error handler collects deprecations in an array instead, so that it collects all deprecations.

Collecting all deprecations instead of only the first one for each templates is better, as it allows to fix them all at once.

Example

No response

@stof stof added TwigBridge Good first issue Ideal for your first contribution! (some Symfony experience may be required) labels Mar 12, 2025
@fabpot fabpot closed this as completed in 2f9677b Mar 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Good first issue Ideal for your first contribution! (some Symfony experience may be required) TwigBridge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants