Skip to content

Commit cedd17b

Browse files
Merge branch '5.4' into 6.0
* 5.4: [Lock] fix tests [Serializer] Ensuring end of line character apply with constructor settings in CSV encoder [Serializer] Fix ignored callbacks in denormalization fix sorting bug
2 parents a6a07c8 + 2c5e62c commit cedd17b

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ protected function sortTaggedServicesByPriority(array $services): array
248248
{
249249
$maxPriority = [];
250250
foreach ($services as $service => $tags) {
251-
$maxPriority[$service] = 0;
251+
$maxPriority[$service] = \PHP_INT_MIN;
252252
foreach ($tags as $tag) {
253253
$currentPriority = $tag['priority'] ?? 0;
254254
if ($maxPriority[$service] < $currentPriority) {

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ public static function getContainerDefinitionsWithPriorityTags()
191191
$definition1 = new Definition('Full\\Qualified\\Class1');
192192
$definition2 = new Definition('Full\\Qualified\\Class2');
193193
$definition3 = new Definition('Full\\Qualified\\Class3');
194+
$definition4 = new Definition('Full\\Qualified\\Class4');
194195

195196
return [
196197
'definition_1' => $definition1
@@ -219,6 +220,13 @@ public static function getContainerDefinitionsWithPriorityTags()
219220
->setAbstract(false)
220221
->addTag('tag1', ['attr1' => 'val1', 'attr2' => 'val2', 'priority' => 0])
221222
->addTag('tag1', ['attr3' => 'val3', 'priority' => 40]),
223+
'definition_4' => $definition4
224+
->setPublic(true)
225+
->setSynthetic(true)
226+
->setFile('/path/to/file')
227+
->setLazy(false)
228+
->setAbstract(false)
229+
->addTag('tag1', ['priority' => 0]),
222230
];
223231
}
224232

Tests/Fixtures/Descriptor/builder_priority_tag.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@
6363
}
6464
]
6565
},
66+
"definition_4": {
67+
"class": "Full\\Qualified\\Class4",
68+
"public": true,
69+
"synthetic": true,
70+
"lazy": false,
71+
"shared": true,
72+
"abstract": false,
73+
"autowire": false,
74+
"autoconfigure": false,
75+
"file": "\/path\/to\/file",
76+
"tags": [
77+
{
78+
"name": "tag1",
79+
"parameters": {
80+
"priority": 0
81+
}
82+
}
83+
]
84+
},
6685
"definition_2": {
6786
"class": "Full\\Qualified\\Class2",
6887
"public": true,

Tests/Fixtures/Descriptor/builder_priority_tag.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ Definitions
4444
- Attr2: val2
4545
- Tag: `tag2`
4646

47+
### definition_4
48+
49+
- Class: `Full\Qualified\Class4`
50+
- Public: yes
51+
- Synthetic: yes
52+
- Lazy: no
53+
- Shared: yes
54+
- Abstract: no
55+
- Autowired: no
56+
- Autoconfigured: no
57+
- File: `/path/to/file`
58+
- Tag: `tag1`
59+
- Priority: 0
60+
4761
### definition_2
4862

4963
- Class: `Full\Qualified\Class2`

Tests/Fixtures/Descriptor/builder_priority_tag.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
(same service as previous, another tag) val1 val2 0
1010
definition_1 val1 30 Full\Qualified\Class1
1111
(same service as previous, another tag) val2
12+
definition_4 0 Full\Qualified\Class4
1213
definition_2 val1 val2 -20 Full\Qualified\Class2
1314
------------------------------------------ ------- ------- ---------- ------- -----------------------
1415

Tests/Fixtures/Descriptor/builder_priority_tag.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
<tag name="tag2"/>
3030
</tags>
3131
</definition>
32+
<definition id="definition_4" class="Full\Qualified\Class4" public="true" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="/path/to/file">
33+
<tags>
34+
<tag name="tag1">
35+
<parameter name="priority">0</parameter>
36+
</tag>
37+
</tags>
38+
</definition>
3239
<definition id="definition_2" class="Full\Qualified\Class2" public="true" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="/path/to/file">
3340
<tags>
3441
<tag name="tag1">

0 commit comments

Comments
 (0)