Skip to content

Twig attributes: make methods public #805

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

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

gharlan
Copy link
Contributor

@gharlan gharlan commented Jun 30, 2025

My twig function/filter methods are often private. But when using the new attributes, they have to be public.

@samsonasik
Copy link
Member

Could you add reference when it must be public?

@gharlan
Copy link
Contributor Author

gharlan commented Jun 30, 2025

Could you add reference when it must be public?

They must be public when using the attributes, because they are called directly from the outside.
Private methods with AsTwigFilter or AsTwigFunction are ignored.

@TomasVotruba
Copy link
Member

I see. Thanks for the description and the fix @gharlan 👍

@TomasVotruba TomasVotruba merged commit c144f25 into rectorphp:main Jun 30, 2025
5 checks passed
@gharlan gharlan deleted the twig-methods-public branch June 30, 2025 09:56
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.

3 participants