Skip to content

Commit 84a514c

Browse files
committed
Merge branch '5.2' into 5.x
* 5.2: [DependencyInjection] Add missing bool type in procesValue() [CI] Make sure to restore default locale
2 parents a24590d + ef17a59 commit 84a514c

File tree

7 files changed

+37
-2
lines changed

7 files changed

+37
-2
lines changed

src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(bool $autoload = false, array $skippedIds = [])
7878
/**
7979
* {@inheritdoc}
8080
*/
81-
protected function processValue($value, $isRoot = false)
81+
protected function processValue($value, bool $isRoot = false)
8282
{
8383
if (isset($this->skippedIds[$this->currentId])) {
8484
return $value;

src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
2626

2727
protected $csrfTokenManager;
2828
protected $testableFeatures = [];
29+
private $defaultLocale;
2930

3031
protected function setUp(): void
3132
{
3233
if (!\extension_loaded('intl')) {
3334
$this->markTestSkipped('Extension intl is required.');
3435
}
3536

37+
$this->defaultLocale = \Locale::getDefault();
3638
\Locale::setDefault('en');
3739

3840
$this->csrfTokenManager = $this->createMock(CsrfTokenManagerInterface::class);
@@ -50,6 +52,7 @@ protected function getExtensions()
5052
protected function tearDown(): void
5153
{
5254
$this->csrfTokenManager = null;
55+
\Locale::setDefault($this->defaultLocale);
5356

5457
parent::tearDown();
5558
}

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class DateTimeToLocalizedStringTransformerTest extends TestCase
2323

2424
protected $dateTime;
2525
protected $dateTimeWithoutSeconds;
26+
private $defaultLocale;
2627

2728
protected function setUp(): void
2829
{
@@ -37,6 +38,7 @@ protected function setUp(): void
3738
// Since we test against "de_AT", we need the full implementation
3839
IntlTestHelper::requireFullIntl($this, '57.1');
3940

41+
$this->defaultLocale = \Locale::getDefault();
4042
\Locale::setDefault('de_AT');
4143

4244
$this->dateTime = new \DateTime('2010-02-03 04:05:06 UTC');
@@ -47,6 +49,7 @@ protected function tearDown(): void
4749
{
4850
$this->dateTime = null;
4951
$this->dateTimeWithoutSeconds = null;
52+
\Locale::setDefault($this->defaultLocale);
5053
}
5154

5255
public function dataProvider()

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919
class MoneyToLocalizedStringTransformerTest extends TestCase
2020
{
2121
private $previousLocale;
22+
private $defaultLocale;
2223

2324
protected function setUp(): void
2425
{
2526
$this->previousLocale = setlocale(\LC_ALL, '0');
27+
$this->defaultLocale = \Locale::getDefault();
2628
}
2729

2830
protected function tearDown(): void
2931
{
3032
setlocale(\LC_ALL, $this->previousLocale);
33+
\Locale::setDefault($this->defaultLocale);
3134
}
3235

3336
public function testTransform()

src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,20 @@ class DateTimeTypeTest extends BaseTypeTest
1818
{
1919
public const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\DateTimeType';
2020

21+
private $defaultLocale;
22+
2123
protected function setUp(): void
2224
{
25+
$this->defaultLocale = \Locale::getDefault();
2326
\Locale::setDefault('en');
24-
2527
parent::setUp();
2628
}
2729

30+
protected function tearDown(): void
31+
{
32+
\Locale::setDefault($this->defaultLocale);
33+
}
34+
2835
public function testSubmitDateTime()
2936
{
3037
$form = $this->factory->create(static::TESTED_TYPE, null, [

src/Symfony/Component/Intl/Tests/ResourceBundleTestCase.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,20 @@ abstract class ResourceBundleTestCase extends TestCase
724724
];
725725

726726
private static $rootLocales;
727+
private $defaultLocale;
727728

728729
protected function setUp(): void
729730
{
731+
$this->defaultLocale = \Locale::getDefault();
730732
Locale::setDefault('en');
731733
Locale::setDefaultFallback('en');
732734
}
733735

736+
protected function tearDown(): void
737+
{
738+
\Locale::setDefault($this->defaultLocale);
739+
}
740+
734741
public function provideLocales()
735742
{
736743
return array_map(

src/Symfony/Contracts/Translation/Test/TranslatorTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
*/
3131
class TranslatorTest extends TestCase
3232
{
33+
private $defaultLocale;
34+
35+
protected function setUp(): void
36+
{
37+
$this->defaultLocale = \Locale::getDefault();
38+
}
39+
40+
protected function tearDown(): void
41+
{
42+
\Locale::setDefault($this->defaultLocale);
43+
}
44+
3345
public function getTranslator()
3446
{
3547
return new class() implements TranslatorInterface {

0 commit comments

Comments
 (0)