Skip to content

Commit c69fc1c

Browse files
minor symfony#49414 Fix Request locale property doc types (bytestream)
This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- Fix Request locale property doc types | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - 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 the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> As shown by https://github.com/symfony/symfony/blob/b9eef0fb17a75b533b67ae15d291126a1ae8c93f/src/Symfony/Component/HttpFoundation/Request.php#L1391 the `locale` property can be `null`. Commits ------- a05604e Fix Request locale property doc types
2 parents 187c319 + a05604e commit c69fc1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Request
191191
protected $session;
192192

193193
/**
194-
* @var string
194+
* @var string|null
195195
*/
196196
protected $locale;
197197

@@ -1452,7 +1452,7 @@ public function setLocale(string $locale)
14521452
*/
14531453
public function getLocale()
14541454
{
1455-
return null === $this->locale ? $this->defaultLocale : $this->locale;
1455+
return $this->locale ?? $this->defaultLocale;
14561456
}
14571457

14581458
/**

0 commit comments

Comments
 (0)