-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] deprecate passing a null locale #32415
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
[Translation] deprecate passing a null locale #32415
Conversation
e477bf2
to
b10b6ae
Compare
de68757
to
1adaabc
Compare
Status: Needs Review |
@@ -527,7 +549,6 @@ public function getValidLocalesTests() | |||
{ | |||
return [ | |||
[''], | |||
[null], |
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.
this test provider is used in a lot of tests and in most of them a null locale is meant to be supported. so you can't just remove this here.
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.
Deprecations are missing 2 words.
bca34cf
to
c25ced6
Compare
src/Symfony/Component/Translation/Tests/MessageCatalogueTest.php
Outdated
Show resolved
Hide resolved
f093ebe
to
815024a
Compare
@@ -184,12 +184,25 @@ public function testAddResourceInvalidLocales($locale) | |||
*/ | |||
public function testAddResourceValidLocales($locale) | |||
{ | |||
if (null === $locale) { | |||
$this->markTestSkipped('null is not a valid locale'); |
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.
why not remove null
from getValidLocalesTests instead? this would look legit to me.
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.
because of #32415 (comment) I don't know it seems that it used in places that can be null
EDIT: Just checked it's used
815024a
to
088615d
Compare
Thank you @Simperfit. |
This PR was merged into the 4.4 branch. Discussion ---------- [Translation] deprecate passing a null locale | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | none <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | not needed <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch. --> According to the discussion in #32386 (comment) it seems that allowing null here was not the right thing to do, so we are deprecating this behaviour. Commits ------- 088615d [Translation] deprecate passing a null locale
According to the discussion in #32386 (comment) it seems that allowing null here was not the right thing to do, so we are deprecating this behaviour.