Skip to content

Commit f634753

Browse files
Merge branch '6.0' into 6.1
* 6.0: [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 1125258 + 4e9512e commit f634753

17 files changed

+137
-5
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa
245245
if ($factory[0] instanceof Reference) {
246246
$data['factory_service'] = (string) $factory[0];
247247
} elseif ($factory[0] instanceof Definition) {
248-
throw new \InvalidArgumentException('Factory is not describable.');
248+
$data['factory_class'] = $factory[0]->getClass() ?? 'not configured';
249249
} else {
250250
$data['factory_class'] = $factory[0];
251251
}

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
224224
if ($factory[0] instanceof Reference) {
225225
$output .= "\n".'- Factory Service: `'.$factory[0].'`';
226226
} elseif ($factory[0] instanceof Definition) {
227-
throw new \InvalidArgumentException('Factory is not describable.');
227+
$output .= "\n".'- Factory Class: `'.($factory[0]->getClass() ?? 'not configured').'`';
228228
} else {
229229
$output .= "\n".'- Factory Class: `'.$factory[0].'`';
230230
}

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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@
3434
"parameters": []
3535
}
3636
]
37+
},
38+
".definition_3": {
39+
"class": "Full\\Qualified\\Class3",
40+
"public": false,
41+
"synthetic": false,
42+
"lazy": false,
43+
"shared": true,
44+
"abstract": false,
45+
"autowire": false,
46+
"autoconfigure": false,
47+
"file": "\/path\/to\/file",
48+
"factory_class": "Full\\Qualified\\FactoryClass",
49+
"factory_method": "get",
50+
"tags": []
3751
}
3852
},
3953
"aliases": {

Tests/Fixtures/Descriptor/builder_1_services.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ Definitions
2525
- Attr3: val3
2626
- Tag: `tag2`
2727

28+
### .definition_3
29+
30+
- Class: `Full\Qualified\Class3`
31+
- Public: no
32+
- Synthetic: no
33+
- Lazy: no
34+
- Shared: yes
35+
- Abstract: no
36+
- Autowired: no
37+
- Autoconfigured: no
38+
- File: `/path/to/file`
39+
- Factory Class: `Full\Qualified\FactoryClass`
40+
- Factory Method: `get`
41+
2842

2943
Aliases
3044
-------

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" file="/path/to/file">
21+
<factory class="Full\Qualified\FactoryClass" method="get"/>
22+
</definition>
2023
</container>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
"file": "\/path\/to\/file",
11+
"factory_class": "Full\\Qualified\\FactoryClass",
12+
"factory_method": "get",
13+
"tags": []
14+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
- File: `/path/to/file`
10+
- Factory Class: `Full\Qualified\FactoryClass`
11+
- Factory Method: `get`
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
---------------- -----------------------------
18+
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" file="/path/to/file">
3+
<factory class="Full\Qualified\FactoryClass" method="get"/>
4+
</definition>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
"arguments": [],
11+
"file": "\/path\/to\/file",
12+
"factory_class": "Full\\Qualified\\FactoryClass",
13+
"factory_method": "get",
14+
"tags": []
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
- Arguments: no
10+
- File: `/path/to/file`
11+
- Factory Class: `Full\Qualified\FactoryClass`
12+
- Factory Method: `get`
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
---------------- -----------------------------
18+
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" file="/path/to/file">
3+
<factory class="Full\Qualified\FactoryClass" method="get"/>
4+
</definition>

0 commit comments

Comments
 (0)