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

Services with tag twig.extension should implement Twig_ExtensionInterface #1292

Merged
merged 1 commit into from
Mar 25, 2019

Conversation

vdechenaux
Copy link
Contributor

Context: Twig >= 1.38.0 or >= 2.7.0

Before:

  • Twig_Extension aliased to Twig\Extension\AbstractExtension

After:

  • Twig\Extension\AbstractExtension aliased to Twig_Extension

But we cannot just check for Twig\Extension\AbstractExtension instead of \Twig_Extension because users with old Twig version don't have this class.

So, we check with the interface \Twig_ExtensionInterface because it exists since 1.0.0 and 2.0.0 and works with >= 1.38.0 and >= 2.7.0 because \Twig\Extension\ExtensionInterface is aliased to \Twig_ExtensionInterface

image
image

…face

Context: Twig >= 1.38.0 or >= 2.7.0

Before:
- Twig_Extension aliased to Twig\Extension\AbstractExtension

After:
- Twig\Extension\AbstractExtension aliased to Twig_Extension

But we cannot just check for Twig\Extension\AbstractExtension instead of \Twig_Extension because users with old Twig version don't have this class.

So, we check with the interface \Twig_ExtensionInterface because it exists since 1.0.0 and 2.0.0 and works with >= 1.38.0 and >= 2.7.0 because \Twig\Extension\ExtensionInterface is aliased to  \Twig_ExtensionInterface
@Haehnchen
Copy link
Owner

thx 👍

@Haehnchen Haehnchen merged commit 10a06c6 into Haehnchen:master Mar 25, 2019
@vdechenaux vdechenaux deleted the twig-extension-interface branch March 25, 2019 17:31
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.

None yet

2 participants