Skip to content

Commit 3c06f4c

Browse files
Merge branch '4.2'
* 4.2: [Routing] dont redirect routes with greedy trailing vars with no explicit slash skip native serialize among child and parent serializable objects [Routing] backport tests from 4.1 [MonologBridge] Remove unused local variable Remove unreachable code Add PackageNameTest to ConfigurationTest also add in the changelog the corresponding entry to this PR Support use of hyphen in asset package name Fix format strings for deprecation notices Remove a harmless duplicate array key from VarDumper [VarDumper] Fixed search bar Remove gendered pronouns Replace gender by eye color in tests [Security] dont do nested calls to serialize()
2 parents 385542c + 5707ad2 commit 3c06f4c

File tree

11 files changed

+44
-14
lines changed

11 files changed

+44
-14
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ private function addAssetsSection(ArrayNodeDefinition $rootNode)
648648
->fixXmlConfig('package')
649649
->children()
650650
->arrayNode('packages')
651+
->normalizeKeys(false)
651652
->useAttributeAsKey('name')
652653
->prototype('array')
653654
->fixXmlConfig('base_url')

Templating/Helper/TranslatorHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function trans($id, array $parameters = [], $domain = 'messages', $locale
5858
*/
5959
public function transChoice($id, $number, array $parameters = [], $domain = 'messages', $locale = null)
6060
{
61-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
61+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED);
6262

6363
if (null === $this->translator) {
6464
return $this->doTrans($id, ['%count%' => $number] + $parameters, $domain, $locale);

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,35 @@ public function testAssetsCanBeEnabled()
101101
$this->assertEquals($defaultConfig, $config['assets']);
102102
}
103103

104+
/**
105+
* @dataProvider provideValidAssetsPackageNameConfigurationTests
106+
*/
107+
public function testValidAssetsPackageNameConfiguration($packageName)
108+
{
109+
$processor = new Processor();
110+
$configuration = new Configuration(true);
111+
$config = $processor->processConfiguration($configuration, [
112+
[
113+
'assets' => [
114+
'packages' => [
115+
$packageName => [],
116+
],
117+
],
118+
],
119+
]);
120+
121+
$this->assertArrayHasKey($packageName, $config['assets']['packages']);
122+
}
123+
124+
public function provideValidAssetsPackageNameConfigurationTests()
125+
{
126+
return [
127+
['foobar'],
128+
['foo-bar'],
129+
['foo_bar'],
130+
];
131+
}
132+
104133
/**
105134
* @dataProvider provideInvalidAssetConfigurationTests
106135
*/

Tests/Fixtures/Serialization/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Author
66
{
7-
public $gender;
7+
public $eyeColor;
88
}

Tests/Fixtures/Serialization/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Person
66
{
7-
public $gender;
7+
public $eyeColor;
88
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serialization\Author:
22
attributes:
3-
gender:
3+
eyeColor:
44
groups: ['group1', 'group2']

Tests/Fixtures/Serialization/Resources/person.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
http://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"
66
>
77
<class name="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serialization\Person">
8-
<attribute name="gender">
8+
<attribute name="eyeColor">
99
<group>group1</group>
1010
<group>group2</group>
1111
</attribute>

Tests/Fixtures/Validation/Author.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Author
66
{
7-
public $gender;
7+
public $eyeColor;
88
}

Tests/Fixtures/Validation/Person.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
class Person
66
{
7-
public $gender;
7+
public $eyeColor;
88
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Author:
22
properties:
3-
gender:
4-
- Choice: { choices: [male, female, other], message: Choose a valid gender. }
3+
eyeColor:
4+
- Choice: { choices: [brown, green, blue], message: Choose a valid eye color. }

Tests/Fixtures/Validation/Resources/person.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
55

66
<class name="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Validation\Person">
7-
<property name="gender">
7+
<property name="eyeColor">
88
<constraint name="Choice">
99
<option name="choices">
10-
<value>male</value>
11-
<value>female</value>
12-
<value>other</value>
10+
<value>brown</value>
11+
<value>green</value>
12+
<value>blue</value>
1313
</option>
14-
<option name="message">Choose a valid gender.</option>
14+
<option name="message">Choose a valid eye color.</option>
1515
</constraint>
1616
</property>
1717
</class>

0 commit comments

Comments
 (0)