bug #25996 Don't show wanna-be-private services as public in debug:container (chalasr)
This PR was merged into the 3.4 branch.
Discussion
----------
Don't show wanna-be-private services as public in debug:container
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #25987
| License | MIT
| Doc PR | n/a
Commits
-------
31f43e5226
Don't show wanna-be-private services as public in debug:container
This commit is contained in:
commit
14615247c1
@ -113,11 +113,11 @@ class JsonDescriptor extends Descriptor
|
||||
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
||||
|
||||
if ($service instanceof Alias) {
|
||||
if ($showPrivate || $service->isPublic()) {
|
||||
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
|
||||
$data['aliases'][$serviceId] = $this->getContainerAliasData($service);
|
||||
}
|
||||
} elseif ($service instanceof Definition) {
|
||||
if (($showPrivate || $service->isPublic())) {
|
||||
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
|
||||
$data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
|
||||
}
|
||||
} else {
|
||||
@ -217,7 +217,7 @@ class JsonDescriptor extends Descriptor
|
||||
{
|
||||
$data = array(
|
||||
'class' => (string) $definition->getClass(),
|
||||
'public' => $definition->isPublic(),
|
||||
'public' => $definition->isPublic() && !$definition->isPrivate(),
|
||||
'synthetic' => $definition->isSynthetic(),
|
||||
'lazy' => $definition->isLazy(),
|
||||
'shared' => $definition->isShared(),
|
||||
@ -281,7 +281,7 @@ class JsonDescriptor extends Descriptor
|
||||
{
|
||||
return array(
|
||||
'service' => (string) $alias,
|
||||
'public' => $alias->isPublic(),
|
||||
'public' => $alias->isPublic() && !$alias->isPrivate(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -139,11 +139,11 @@ class MarkdownDescriptor extends Descriptor
|
||||
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
||||
|
||||
if ($service instanceof Alias) {
|
||||
if ($showPrivate || $service->isPublic()) {
|
||||
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
|
||||
$services['aliases'][$serviceId] = $service;
|
||||
}
|
||||
} elseif ($service instanceof Definition) {
|
||||
if (($showPrivate || $service->isPublic())) {
|
||||
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
|
||||
$services['definitions'][$serviceId] = $service;
|
||||
}
|
||||
} else {
|
||||
@ -182,7 +182,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
protected function describeContainerDefinition(Definition $definition, array $options = array())
|
||||
{
|
||||
$output = '- Class: `'.$definition->getClass().'`'
|
||||
."\n".'- Public: '.($definition->isPublic() ? 'yes' : 'no')
|
||||
."\n".'- Public: '.($definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no')
|
||||
."\n".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
|
||||
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
|
||||
."\n".'- Shared: '.($definition->isShared() ? 'yes' : 'no')
|
||||
@ -246,7 +246,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null)
|
||||
{
|
||||
$output = '- Service: `'.$alias.'`'
|
||||
."\n".'- Public: '.($alias->isPublic() ? 'yes' : 'no');
|
||||
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');
|
||||
|
||||
if (!isset($options['id'])) {
|
||||
return $this->write($output);
|
||||
|
@ -194,7 +194,7 @@ class TextDescriptor extends Descriptor
|
||||
$definition = $this->resolveServiceDefinition($builder, $serviceId);
|
||||
if ($definition instanceof Definition) {
|
||||
// filter out private services unless shown explicitly
|
||||
if (!$showPrivate && !$definition->isPublic()) {
|
||||
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
|
||||
unset($serviceIds[$key]);
|
||||
continue;
|
||||
}
|
||||
@ -212,7 +212,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
}
|
||||
} elseif ($definition instanceof Alias) {
|
||||
if (!$showPrivate && !$definition->isPublic()) {
|
||||
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
|
||||
unset($serviceIds[$key]);
|
||||
continue;
|
||||
}
|
||||
@ -302,7 +302,7 @@ class TextDescriptor extends Descriptor
|
||||
$tableRows[] = array('Calls', implode(', ', $callInformation));
|
||||
}
|
||||
|
||||
$tableRows[] = array('Public', $definition->isPublic() ? 'yes' : 'no');
|
||||
$tableRows[] = array('Public', $definition->isPublic() && !$definition->isPrivate() ? 'yes' : 'no');
|
||||
$tableRows[] = array('Synthetic', $definition->isSynthetic() ? 'yes' : 'no');
|
||||
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
|
||||
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');
|
||||
|
@ -318,7 +318,7 @@ class XmlDescriptor extends Descriptor
|
||||
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
|
||||
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
||||
|
||||
if (($service instanceof Definition || $service instanceof Alias) && !($showPrivate || $service->isPublic())) {
|
||||
if (($service instanceof Definition || $service instanceof Alias) && !($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ class XmlDescriptor extends Descriptor
|
||||
}
|
||||
}
|
||||
|
||||
$serviceXML->setAttribute('public', $definition->isPublic() ? 'true' : 'false');
|
||||
$serviceXML->setAttribute('public', $definition->isPublic() && !$definition->isPrivate() ? 'true' : 'false');
|
||||
$serviceXML->setAttribute('synthetic', $definition->isSynthetic() ? 'true' : 'false');
|
||||
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
|
||||
$serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false');
|
||||
@ -469,7 +469,7 @@ class XmlDescriptor extends Descriptor
|
||||
}
|
||||
|
||||
$aliasXML->setAttribute('service', (string) $alias);
|
||||
$aliasXML->setAttribute('public', $alias->isPublic() ? 'true' : 'false');
|
||||
$aliasXML->setAttribute('public', $alias->isPublic() && !$alias->isPrivate() ? 'true' : 'false');
|
||||
|
||||
return $dom;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
"%parameter%",
|
||||
{
|
||||
"class": "inline_service",
|
||||
"public": true,
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
@ -39,7 +39,7 @@
|
||||
},
|
||||
{
|
||||
"class": "inline_service",
|
||||
"public": true,
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
|
@ -6,7 +6,7 @@
|
||||
<argument type="service" id="definition2"/>
|
||||
<argument>%parameter%</argument>
|
||||
<argument>
|
||||
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<argument>arg1</argument>
|
||||
<argument>arg2</argument>
|
||||
</definition>
|
||||
@ -15,7 +15,7 @@
|
||||
<argument>foo</argument>
|
||||
<argument type="service" id="definition2"/>
|
||||
<argument>
|
||||
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
</argument>
|
||||
</argument>
|
||||
<argument type="iterator">
|
||||
|
@ -15,7 +15,7 @@
|
||||
"%parameter%",
|
||||
{
|
||||
"class": "inline_service",
|
||||
"public": true,
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"class": "inline_service",
|
||||
"public": true,
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
|
@ -4,7 +4,7 @@
|
||||
<argument type="service" id="definition2"/>
|
||||
<argument>%parameter%</argument>
|
||||
<argument>
|
||||
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<argument>arg1</argument>
|
||||
<argument>arg2</argument>
|
||||
</definition>
|
||||
@ -13,7 +13,7 @@
|
||||
<argument>foo</argument>
|
||||
<argument type="service" id="definition2"/>
|
||||
<argument>
|
||||
<definition class="inline_service" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
<definition class="inline_service" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
</argument>
|
||||
</argument>
|
||||
<argument type="iterator">
|
||||
|
Reference in New Issue
Block a user