Skip to content

[Translation] Moved PhpExtractor and PhpStringTokenParser to Translation component #24197

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
Sep 28, 2017

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Sep 14, 2017

Q A
Branch? 3.4
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? yes
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Extraction of translations keys does not really belong to the framework bundle. It is related to the translation component.

*/
class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface
class PhpExtractor extends \Symfony\Component\Translation\Extractor\PhpExtractor
Copy link
Member

@nicolas-grekas nicolas-grekas Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't work as a BC layer: PhpExtractor instanceof PhpExtractor should be true whatever the namespaces.
the proper way to do so is using class_alias+class_exists.
see BC layer of ChildDefinition/DefinitionDecorator as an example.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the issue with class_alias is that you won't get a deprecation warning when using the old class name if the new one was autoloaded first.

For PhpExtractor, support for ComponentExtractor instanceof BundleExtractor is not needed IMO, as extractors are not really something you inspect this way (you instantiate them to pass them to the extraction layer).
We have many cases where we create a new class and make the deprecated one extend the new one.

@nicolas-grekas nicolas-grekas force-pushed the php-extractor branch 2 times, most recently from 44a83a1 to 4407cd3 Compare September 28, 2017 23:34
@fabpot
Copy link
Member

fabpot commented Sep 28, 2017

Thank you @Nyholm.

@fabpot fabpot merged commit eca2f8e into symfony:3.4 Sep 28, 2017
fabpot added a commit that referenced this pull request Sep 28, 2017
…ser to Translation component (Nyholm)

This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] 	Moved PhpExtractor and PhpStringTokenParser to Translation component

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Extraction of translations keys does not really belong to the framework bundle. It is related to the translation component.

Commits
-------

eca2f8e Moved PhpExtractor and PhpStringTokenParser to Translation component
@Nyholm Nyholm deleted the php-extractor branch September 29, 2017 08:53
This was referenced Oct 18, 2017
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.

5 participants