Skip to content

Commit 63a3b62

Browse files
author
Robin Chalas
committed
Merge branch '4.0'
* 4.0: [Intl] Fixed the broken link Fix typo Fix typo Fixed issue #25985 Don't show wanna-be-private services as public in debug:container [Routing] Fix trailing slash redirection for non-safe verbs [DI] Fix tracking of source class changes for lazy-proxies Proxy class names should be deterministic and independent of spl_object_hash() which is somewhat random [Debug] Fix bad registration of exception handler, leading to mem leak [Form] Fixed empty data on expanded ChoiceType and FileType collect extension information as late as possible
2 parents 3382700 + a587cbc commit 63a3b62

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
113113
$service = $this->resolveServiceDefinition($builder, $serviceId);
114114

115115
if ($service instanceof Alias) {
116-
if ($showPrivate || $service->isPublic()) {
116+
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
117117
$data['aliases'][$serviceId] = $this->getContainerAliasData($service);
118118
}
119119
} elseif ($service instanceof Definition) {
120-
if (($showPrivate || $service->isPublic())) {
120+
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
121121
$data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
122122
}
123123
} else {
@@ -211,7 +211,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa
211211
{
212212
$data = array(
213213
'class' => (string) $definition->getClass(),
214-
'public' => $definition->isPublic(),
214+
'public' => $definition->isPublic() && !$definition->isPrivate(),
215215
'synthetic' => $definition->isSynthetic(),
216216
'lazy' => $definition->isLazy(),
217217
'shared' => $definition->isShared(),
@@ -265,7 +265,7 @@ private function getContainerAliasData(Alias $alias): array
265265
{
266266
return array(
267267
'service' => (string) $alias,
268-
'public' => $alias->isPublic(),
268+
'public' => $alias->isPublic() && !$alias->isPrivate(),
269269
);
270270
}
271271

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
139139
$service = $this->resolveServiceDefinition($builder, $serviceId);
140140

141141
if ($service instanceof Alias) {
142-
if ($showPrivate || $service->isPublic()) {
142+
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
143143
$services['aliases'][$serviceId] = $service;
144144
}
145145
} elseif ($service instanceof Definition) {
146-
if (($showPrivate || $service->isPublic())) {
146+
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
147147
$services['definitions'][$serviceId] = $service;
148148
}
149149
} else {
@@ -182,7 +182,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
182182
protected function describeContainerDefinition(Definition $definition, array $options = array())
183183
{
184184
$output = '- Class: `'.$definition->getClass().'`'
185-
."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no')
185+
."\n".'- Public: '.($definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no')
186186
."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
187187
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
188188
."\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no')
@@ -239,7 +239,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
239239
protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null)
240240
{
241241
$output = '- Service: `'.$alias.'`'
242-
."\n".'- Public: '.($alias->isPublic() ? 'yes' : 'no');
242+
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');
243243

244244
if (!isset($options['id'])) {
245245
return $this->write($output);

Console/Descriptor/TextDescriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
194194
$definition = $this->resolveServiceDefinition($builder, $serviceId);
195195
if ($definition instanceof Definition) {
196196
// filter out private services unless shown explicitly
197-
if (!$showPrivate && !$definition->isPublic()) {
197+
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
198198
unset($serviceIds[$key]);
199199
continue;
200200
}
@@ -212,7 +212,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
212212
}
213213
}
214214
} elseif ($definition instanceof Alias) {
215-
if (!$showPrivate && !$definition->isPublic()) {
215+
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
216216
unset($serviceIds[$key]);
217217
continue;
218218
}
@@ -302,7 +302,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
302302
$tableRows[] = array('Calls', implode(', ', $callInformation));
303303
}
304304

305-
$tableRows[] = array('Public', $definition->isPublic() ? 'yes' : 'no');
305+
$tableRows[] = array('Public', $definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no');
306306
$tableRows[] = array('Synthetic', $definition->isSynthetic() ? 'yes' : 'no');
307307
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
308308
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');

Console/Descriptor/XmlDescriptor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ private function getContainerServicesDocument(ContainerBuilder $builder, string
283283
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
284284
$service = $this->resolveServiceDefinition($builder, $serviceId);
285285

286-
if (($service instanceof Definition || $service instanceof Alias) && !($showPrivate || $service->isPublic())) {
286+
if (($service instanceof Definition || $service instanceof Alias) && !($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
287287
continue;
288288
}
289289

@@ -322,7 +322,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
322322
}
323323
}
324324

325-
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
325+
$serviceXML->setAttribute('public', $definition->isPublic() && !$definition->isPrivate() ? 'true' : 'false');
326326
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
327327
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
328328
$serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false');
@@ -421,7 +421,7 @@ private function getContainerAliasDocument(Alias $alias, string $id = null): \DO
421421
}
422422

423423
$aliasXML->setAttribute('service', (string) $alias);
424-
$aliasXML->setAttribute('public', $alias->isPublic() ? 'true' : 'false');
424+
$aliasXML->setAttribute('public', $alias->isPublic() && !$alias->isPrivate() ? 'true' : 'false');
425425

426426
return $dom;
427427
}

Tests/Fixtures/Descriptor/builder_1_arguments.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"%parameter%",
1818
{
1919
"class": "inline_service",
20-
"public": true,
20+
"public": false,
2121
"synthetic": false,
2222
"lazy": false,
2323
"shared": true,
@@ -39,7 +39,7 @@
3939
},
4040
{
4141
"class": "inline_service",
42-
"public": true,
42+
"public": false,
4343
"synthetic": false,
4444
"lazy": false,
4545
"shared": true,

Tests/Fixtures/Descriptor/builder_1_arguments.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<argument type="service" id="definition2"/>
77
<argument>%parameter%</argument>
88
<argument>
9-
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
9+
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
1010
<argument>arg1</argument>
1111
<argument>arg2</argument>
1212
</definition>
@@ -15,7 +15,7 @@
1515
<argument>foo</argument>
1616
<argument type="service" id="definition2"/>
1717
<argument>
18-
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
18+
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
1919
</argument>
2020
</argument>
2121
<argument type="iterator">

Tests/Fixtures/Descriptor/definition_arguments_1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"%parameter%",
1616
{
1717
"class": "inline_service",
18-
"public": true,
18+
"public": false,
1919
"synthetic": false,
2020
"lazy": false,
2121
"shared": true,
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"class": "inline_service",
40-
"public": true,
40+
"public": false,
4141
"synthetic": false,
4242
"lazy": false,
4343
"shared": true,

Tests/Fixtures/Descriptor/definition_arguments_1.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<argument type="service" id="definition2"/>
55
<argument>%parameter%</argument>
66
<argument>
7-
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
7+
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
88
<argument>arg1</argument>
99
<argument>arg2</argument>
1010
</definition>
@@ -13,7 +13,7 @@
1313
<argument>foo</argument>
1414
<argument type="service" id="definition2"/>
1515
<argument>
16-
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
16+
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
1717
</argument>
1818
</argument>
1919
<argument type="iterator">

0 commit comments

Comments
 (0)