-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Rework PhpAstExtractor
tests organization for future improvements
#60854
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
Open
welcoMattic
wants to merge
8
commits into
symfony:7.4
Choose a base branch
from
welcoMattic:translation/php-ast-extractor-tests-rework
base: 7.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Translation] Rework PhpAstExtractor
tests organization for future improvements
#60854
welcoMattic
wants to merge
8
commits into
symfony:7.4
from
welcoMattic:translation/php-ast-extractor-tests-rework
+672
−194
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19b3d28
to
2ed841f
Compare
stof
requested changes
Jun 20, 2025
src/Symfony/Component/Translation/Tests/Extractor/Visitor/AbstractVisitorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Tests/Extractor/Visitor/AbstractVisitorTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Translation/Tests/Extractor/Visitor/ConstraintVisitorTest.php
Outdated
Show resolved
Hide resolved
...mfony/Component/Translation/Tests/Fixtures/extractor-php-ast/form-type-visitor/form-type.php
Outdated
Show resolved
Hide resolved
...mfony/Component/Translation/Tests/Fixtures/extractor-php-ast/form-type-visitor/form-type.php
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,47 @@ | |||
This template is used for translation message extraction tests | |||
<?php new TranslatableMessage('translatable single-quoted key'); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this missing a use statement ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Also TransMethodVisitor
has be updated to check the full classname.
2ed841f
to
23ead95
Compare
stof
reviewed
Jun 20, 2025
src/Symfony/Component/Translation/Extractor/Visitor/AbstractVisitor.php
Outdated
Show resolved
Hide resolved
…sts-rework-review-0001 [Translation] Rework PhpAstExtractor tests organization for future improvements - REVIEW0001
PhpAstExtractor
tests organization for future improvements
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is the first in a series that tend to improve PhpAstExtractor (covering more extractions cases, ease test writting for new cases, etc).
I've worked with @Jean-Beru, @Kazadri and @jprivet-dev in the past few weeks on various new cases to increase the number of "locations" from where the extractor can extract translation keys.
As we were working on my own Symfony fork, I'm opening the PR.
But to be honest my colleague @Jean-Beru did the large majority of the work here. Thanks to him 👏!
To avoid a big PR containing multiple new small features, we need to open and hopefully merge this one first to ease the tests writting for next new Visitors.
NB: I'm not sure to qualify or not this PR as New feature?