Skip to content

Commit 2c91b1e

Browse files
Merge branch '6.1' into 6.2
* 6.1: [HttpKernel] lock when writting profiles Using identical comparison for path validation [Mime] Fix email rendering when having inlined parts that are not related to the content fix typo [HttpFoundation] move flushing outside of Response::closeOutputBuffers [FrameworkBundle] Do not throw when describing a factory definition Fix checking result of DateTime::getLastErrors [WebProfilerBundle] Fix profile search bar link query params
2 parents 3fc23b6 + f634753 commit 2c91b1e

17 files changed

+151
-5
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa
252252
if ($factory[0] instanceof Reference) {
253253
$data['factory_service'] = (string) $factory[0];
254254
} elseif ($factory[0] instanceof Definition) {
255-
throw new \InvalidArgumentException('Factory is not describable.');
255+
$data['factory_class'] = $factory[0]->getClass() ?? 'not configured';
256256
} else {
257257
$data['factory_class'] = $factory[0];
258258
}

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
231231
if ($factory[0] instanceof Reference) {
232232
$output .= "\n".'- Factory Service: `'.$factory[0].'`';
233233
} elseif ($factory[0] instanceof Definition) {
234-
throw new \InvalidArgumentException('Factory is not describable.');
234+
$output .= "\n".'- Factory Class: `'.($factory[0]->getClass() ?? 'not configured').'`';
235235
} else {
236236
$output .= "\n".'- Factory Class: `'.$factory[0].'`';
237237
}

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
315315
if ($factory[0] instanceof Reference) {
316316
$tableRows[] = ['Factory Service', $factory[0]];
317317
} elseif ($factory[0] instanceof Definition) {
318-
throw new \InvalidArgumentException('Factory is not describable.');
318+
$tableRows[] = ['Factory Class', $factory[0]->getClass() ?? 'not configured'];
319319
} else {
320320
$tableRows[] = ['Factory Class', $factory[0]];
321321
}

Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
324324
if ($factory[0] instanceof Reference) {
325325
$factoryXML->setAttribute('service', (string) $factory[0]);
326326
} elseif ($factory[0] instanceof Definition) {
327-
throw new \InvalidArgumentException('Factory is not describable.');
327+
$factoryXML->setAttribute('class', $factory[0]->getClass() ?? 'not configured');
328328
} else {
329329
$factoryXML->setAttribute('class', $factory[0]);
330330
}

Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public static function getContainerDefinitions()
138138
{
139139
$definition1 = new Definition('Full\\Qualified\\Class1');
140140
$definition2 = new Definition('Full\\Qualified\\Class2');
141+
$definition3 = new Definition('Full\\Qualified\\Class3');
141142

142143
return [
143144
'definition_1' => $definition1
@@ -170,6 +171,9 @@ public static function getContainerDefinitions()
170171
->addTag('tag2')
171172
->addMethodCall('setMailer', [new Reference('mailer')])
172173
->setFactory([new Reference('factory.service'), 'get']),
174+
'.definition_3' => $definition3
175+
->setFile('/path/to/file')
176+
->setFactory([new Definition('Full\\Qualified\\FactoryClass'), 'get']),
173177
'definition_without_class' => new Definition(),
174178
];
175179
}

Tests/Fixtures/Descriptor/builder_1_services.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@
3636
}
3737
],
3838
"usages": []
39+
},
40+
".definition_3": {
41+
"class": "Full\\Qualified\\Class3",
42+
"public": false,
43+
"synthetic": false,
44+
"lazy": false,
45+
"shared": true,
46+
"abstract": false,
47+
"autowire": false,
48+
"autoconfigure": false,
49+
"deprecated": false,
50+
"file": "\/path\/to\/file",
51+
"factory_class": "Full\\Qualified\\FactoryClass",
52+
"factory_method": "get",
53+
"tags": [],
54+
"usages": []
3955
}
4056
},
4157
"aliases": {

Tests/Fixtures/Descriptor/builder_1_services.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ Definitions
2727
- Tag: `tag2`
2828
- Usages: none
2929

30+
### .definition_3
31+
32+
- Class: `Full\Qualified\Class3`
33+
- Public: no
34+
- Synthetic: no
35+
- Lazy: no
36+
- Shared: yes
37+
- Abstract: no
38+
- Autowired: no
39+
- Autoconfigured: no
40+
- Deprecated: no
41+
- File: `/path/to/file`
42+
- Factory Class: `Full\Qualified\FactoryClass`
43+
- Factory Method: `get`
44+
- Usages: none
45+
3046

3147
Aliases
3248
-------

Tests/Fixtures/Descriptor/builder_1_services.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
--------------- ------------------------
88
.alias_2 alias for ".service_2"
99
.definition_2 Full\Qualified\Class2
10-
--------------- ------------------------
10+
.definition_3 Full\Qualified\Class3
11+
--------------- ------------------------
1112

Tests/Fixtures/Descriptor/builder_1_services.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
<tag name="tag2"/>
1818
</tags>
1919
</definition>
20+
<definition id=".definition_3" class="Full\Qualified\Class3" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" deprecated="false" file="/path/to/file">
21+
<factory class="Full\Qualified\FactoryClass" method="get"/>
22+
</definition>
2023
</container>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"class": "Full\\Qualified\\Class3",
3+
"public": false,
4+
"synthetic": false,
5+
"lazy": false,
6+
"shared": true,
7+
"abstract": false,
8+
"autowire": false,
9+
"autoconfigure": false,
10+
"deprecated": false,
11+
"file": "\/path\/to\/file",
12+
"factory_class": "Full\\Qualified\\FactoryClass",
13+
"factory_method": "get",
14+
"tags": [],
15+
"usages": []
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- Class: `Full\Qualified\Class3`
2+
- Public: no
3+
- Synthetic: no
4+
- Lazy: no
5+
- Shared: yes
6+
- Abstract: no
7+
- Autowired: no
8+
- Autoconfigured: no
9+
- Deprecated: no
10+
- File: `/path/to/file`
11+
- Factory Class: `Full\Qualified\FactoryClass`
12+
- Factory Method: `get`
13+
- Usages: none
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---------------- -----------------------------
2+
 Option   Value 
3+
---------------- -----------------------------
4+
Service ID -
5+
Class Full\Qualified\Class3
6+
Tags -
7+
Public no
8+
Synthetic no
9+
Lazy no
10+
Shared yes
11+
Abstract no
12+
Autowired no
13+
Autoconfigured no
14+
Required File /path/to/file
15+
Factory Class Full\Qualified\FactoryClass
16+
Factory Method get
17+
Usages none
18+
---------------- -----------------------------
19+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definition class="Full\Qualified\Class3" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" deprecated="false" file="/path/to/file">
3+
<factory class="Full\Qualified\FactoryClass" method="get"/>
4+
</definition>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"class": "Full\\Qualified\\Class3",
3+
"public": false,
4+
"synthetic": false,
5+
"lazy": false,
6+
"shared": true,
7+
"abstract": false,
8+
"autowire": false,
9+
"autoconfigure": false,
10+
"deprecated": false,
11+
"arguments": [],
12+
"file": "\/path\/to\/file",
13+
"factory_class": "Full\\Qualified\\FactoryClass",
14+
"factory_method": "get",
15+
"tags": [],
16+
"usages": []
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- Class: `Full\Qualified\Class3`
2+
- Public: no
3+
- Synthetic: no
4+
- Lazy: no
5+
- Shared: yes
6+
- Abstract: no
7+
- Autowired: no
8+
- Autoconfigured: no
9+
- Deprecated: no
10+
- Arguments: no
11+
- File: `/path/to/file`
12+
- Factory Class: `Full\Qualified\FactoryClass`
13+
- Factory Method: `get`
14+
- Usages: none
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---------------- -----------------------------
2+
 Option   Value 
3+
---------------- -----------------------------
4+
Service ID -
5+
Class Full\Qualified\Class3
6+
Tags -
7+
Public no
8+
Synthetic no
9+
Lazy no
10+
Shared yes
11+
Abstract no
12+
Autowired no
13+
Autoconfigured no
14+
Required File /path/to/file
15+
Factory Class Full\Qualified\FactoryClass
16+
Factory Method get
17+
Usages none
18+
---------------- -----------------------------
19+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<definition class="Full\Qualified\Class3" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" deprecated="false" file="/path/to/file">
3+
<factory class="Full\Qualified\FactoryClass" method="get"/>
4+
</definition>

0 commit comments

Comments
 (0)