Don't show wanna-be-private services as public in debug:container
This commit is contained in:
parent
5f770d77e8
commit
31f43e5226
@ -113,11 +113,11 @@ class JsonDescriptor extends Descriptor
|
|||||||
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
||||||
|
|
||||||
if ($service instanceof Alias) {
|
if ($service instanceof Alias) {
|
||||||
if ($showPrivate || $service->isPublic()) {
|
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
|
||||||
$data['aliases'][$serviceId] = $this->getContainerAliasData($service);
|
$data['aliases'][$serviceId] = $this->getContainerAliasData($service);
|
||||||
}
|
}
|
||||||
} elseif ($service instanceof Definition) {
|
} elseif ($service instanceof Definition) {
|
||||||
if (($showPrivate || $service->isPublic())) {
|
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
|
||||||
$data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
|
$data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -217,7 +217,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
{
|
{
|
||||||
$data = array(
|
$data = array(
|
||||||
'class' => (string) $definition->getClass(),
|
'class' => (string) $definition->getClass(),
|
||||||
'public' => $definition->isPublic(),
|
'public' => $definition->isPublic() && !$definition->isPrivate(),
|
||||||
'synthetic' => $definition->isSynthetic(),
|
'synthetic' => $definition->isSynthetic(),
|
||||||
'lazy' => $definition->isLazy(),
|
'lazy' => $definition->isLazy(),
|
||||||
'shared' => $definition->isShared(),
|
'shared' => $definition->isShared(),
|
||||||
@ -281,7 +281,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'service' => (string) $alias,
|
'service' => (string) $alias,
|
||||||
'public' => $alias->isPublic(),
|
'public' => $alias->isPublic() && !$alias->isPrivate(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,11 +139,11 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
$service = $this->resolveServiceDefinition($builder, $serviceId);
|
||||||
|
|
||||||
if ($service instanceof Alias) {
|
if ($service instanceof Alias) {
|
||||||
if ($showPrivate || $service->isPublic()) {
|
if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
|
||||||
$services['aliases'][$serviceId] = $service;
|
$services['aliases'][$serviceId] = $service;
|
||||||
}
|
}
|
||||||
} elseif ($service instanceof Definition) {
|
} elseif ($service instanceof Definition) {
|
||||||
if (($showPrivate || $service->isPublic())) {
|
if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
|
||||||
$services['definitions'][$serviceId] = $service;
|
$services['definitions'][$serviceId] = $service;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -182,7 +182,7 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
protected function describeContainerDefinition(Definition $definition, array $options = array())
|
protected function describeContainerDefinition(Definition $definition, array $options = array())
|
||||||
{
|
{
|
||||||
$output = '- Class: `'.$definition->getClass().'`'
|
$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".'- Synthetic: '.($definition->isSynthetic() ? 'yes' : 'no')
|
||||||
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
|
."\n".'- Lazy: '.($definition->isLazy() ? 'yes' : 'no')
|
||||||
."\n".'- Shared: '.($definition->isShared() ? '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)
|
protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null)
|
||||||
{
|
{
|
||||||
$output = '- Service: `'.$alias.'`'
|
$output = '- Service: `'.$alias.'`'
|
||||||
."\n".'- Public: '.($alias->isPublic() ? 'yes' : 'no');
|
."\n".'- Public: '.($alias->isPublic() && !$alias->isPrivate() ? 'yes' : 'no');
|
||||||
|
|
||||||
if (!isset($options['id'])) {
|
if (!isset($options['id'])) {
|
||||||
return $this->write($output);
|
return $this->write($output);
|
||||||
|
@ -194,7 +194,7 @@ class TextDescriptor extends Descriptor
|
|||||||
$definition = $this->resolveServiceDefinition($builder, $serviceId);
|
$definition = $this->resolveServiceDefinition($builder, $serviceId);
|
||||||
if ($definition instanceof Definition) {
|
if ($definition instanceof Definition) {
|
||||||
// filter out private services unless shown explicitly
|
// filter out private services unless shown explicitly
|
||||||
if (!$showPrivate && !$definition->isPublic()) {
|
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
|
||||||
unset($serviceIds[$key]);
|
unset($serviceIds[$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ class TextDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($definition instanceof Alias) {
|
} elseif ($definition instanceof Alias) {
|
||||||
if (!$showPrivate && !$definition->isPublic()) {
|
if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
|
||||||
unset($serviceIds[$key]);
|
unset($serviceIds[$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ class TextDescriptor extends Descriptor
|
|||||||
$tableRows[] = array('Calls', implode(', ', $callInformation));
|
$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('Synthetic', $definition->isSynthetic() ? 'yes' : 'no');
|
||||||
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
|
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
|
||||||
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');
|
$tableRows[] = array('Shared', $definition->isShared() ? 'yes' : 'no');
|
||||||
|
@ -318,7 +318,7 @@ class XmlDescriptor extends Descriptor
|
|||||||
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
|
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
|
||||||
$service = $this->resolveServiceDefinition($builder, $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;
|
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('synthetic', $definition->isSynthetic() ? 'true' : 'false');
|
||||||
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
|
$serviceXML->setAttribute('lazy', $definition->isLazy() ? 'true' : 'false');
|
||||||
$serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false');
|
$serviceXML->setAttribute('shared', $definition->isShared() ? 'true' : 'false');
|
||||||
@ -469,7 +469,7 @@ class XmlDescriptor extends Descriptor
|
|||||||
}
|
}
|
||||||
|
|
||||||
$aliasXML->setAttribute('service', (string) $alias);
|
$aliasXML->setAttribute('service', (string) $alias);
|
||||||
$aliasXML->setAttribute('public', $alias->isPublic() ? 'true' : 'false');
|
$aliasXML->setAttribute('public', $alias->isPublic() && !$alias->isPrivate() ? 'true' : 'false');
|
||||||
|
|
||||||
return $dom;
|
return $dom;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"%parameter%",
|
"%parameter%",
|
||||||
{
|
{
|
||||||
"class": "inline_service",
|
"class": "inline_service",
|
||||||
"public": true,
|
"public": false,
|
||||||
"synthetic": false,
|
"synthetic": false,
|
||||||
"lazy": false,
|
"lazy": false,
|
||||||
"shared": true,
|
"shared": true,
|
||||||
@ -39,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "inline_service",
|
"class": "inline_service",
|
||||||
"public": true,
|
"public": false,
|
||||||
"synthetic": false,
|
"synthetic": false,
|
||||||
"lazy": false,
|
"lazy": false,
|
||||||
"shared": true,
|
"shared": true,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<argument type="service" id="definition2"/>
|
<argument type="service" id="definition2"/>
|
||||||
<argument>%parameter%</argument>
|
<argument>%parameter%</argument>
|
||||||
<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>arg1</argument>
|
||||||
<argument>arg2</argument>
|
<argument>arg2</argument>
|
||||||
</definition>
|
</definition>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<argument>foo</argument>
|
<argument>foo</argument>
|
||||||
<argument type="service" id="definition2"/>
|
<argument type="service" id="definition2"/>
|
||||||
<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>
|
</argument>
|
||||||
</argument>
|
</argument>
|
||||||
<argument type="iterator">
|
<argument type="iterator">
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"%parameter%",
|
"%parameter%",
|
||||||
{
|
{
|
||||||
"class": "inline_service",
|
"class": "inline_service",
|
||||||
"public": true,
|
"public": false,
|
||||||
"synthetic": false,
|
"synthetic": false,
|
||||||
"lazy": false,
|
"lazy": false,
|
||||||
"shared": true,
|
"shared": true,
|
||||||
@ -37,7 +37,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "inline_service",
|
"class": "inline_service",
|
||||||
"public": true,
|
"public": false,
|
||||||
"synthetic": false,
|
"synthetic": false,
|
||||||
"lazy": false,
|
"lazy": false,
|
||||||
"shared": true,
|
"shared": true,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<argument type="service" id="definition2"/>
|
<argument type="service" id="definition2"/>
|
||||||
<argument>%parameter%</argument>
|
<argument>%parameter%</argument>
|
||||||
<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>arg1</argument>
|
||||||
<argument>arg2</argument>
|
<argument>arg2</argument>
|
||||||
</definition>
|
</definition>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<argument>foo</argument>
|
<argument>foo</argument>
|
||||||
<argument type="service" id="definition2"/>
|
<argument type="service" id="definition2"/>
|
||||||
<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>
|
</argument>
|
||||||
</argument>
|
</argument>
|
||||||
<argument type="iterator">
|
<argument type="iterator">
|
||||||
|
Reference in New Issue
Block a user