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
Make function existence deterministic in Twig AppExtension
#3562
Comments
I don't think In the past, functions implementing the built-in filters have been changed between Twig versions (for instance adding the environment as first argument and using @fabpot should we tag all those functions as |
Well, I'm only using it to "fix" the public function dateFilter(Environment $environment, $date, string $format = 'F j, Y H:i:m'): string
{
if (null === $date) {
return '';
}
return twig_date_format_filter($environment, $date, $format);
} Is there a better to do this (other than checking for |
Fixed in Twig 4 where we don't have these functions anymore and their replacements are all internal methods. |
'm just forwarding what @ondrejmirtes told me at phpstan/phpstan#5640 (comment):
Calling
twig_date_format_filter()
inApp\Twig\AppExtension
sometimes leads to phpstan reporting... and sometimes it doesn't ;-)
@ondrejmirtes at symfony/symfony#43067 (comment):
The text was updated successfully, but these errors were encountered: