Skip to content

class attribute still needed in some cases #9592

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
Apr 19, 2018

Conversation

florian987
Copy link
Contributor

The class attribute is still needed for non namespaced classes like Twig_Extensions_Extension_Intl

@javiereguiluz
Copy link
Member

You are right about this. thanks for fixing it!

However, I was checking the source code of Twig extensions (e.g. https://github.com/twigphp/Twig-extensions/blob/master/src/IntlExtension.php) and I saw that it added PHP namespaces in addition to the legacy PHP class names (the same that Twig did a while ago). So maybe a better solution could be to not add the class option but to use the new PHP namespaces?

         services:
-            Twig_Extensions_Extension_Intl:
+            Twig\Extensions\IntlExtension:
-                class: Twig_Extensions_Extension_Intl
                 tags: [twig.extension]

@xabbuh xabbuh added this to the 3.4 milestone Apr 16, 2018
@florian987
Copy link
Contributor Author

I did not know about that, thanks. I updated PR accordingly

@javiereguiluz
Copy link
Member

It's merged now! @florian987 congrats on your first Symfony Docs contribution!

@javiereguiluz javiereguiluz merged commit cb0ee3b into symfony:3.4 Apr 19, 2018
javiereguiluz added a commit that referenced this pull request Apr 19, 2018
This PR was squashed before being merged into the 3.4 branch (closes #9592).

Discussion
----------

class attribute still needed in some cases

The class attribute is still needed for non namespaced classes like Twig_Extensions_Extension_Intl

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

cb0ee3b class attribute still needed in some cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants