bug #30641 [FrameworkBundle] properly describe service definitions without class (xabbuh)
This PR was merged into the 4.2 branch.
Discussion
----------
[FrameworkBundle] properly describe service definitions without class
| Q | A
| ------------- | ---
| Branch? | 4.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #30638
| License | MIT
| Doc PR |
Commits
-------
e5b0fd37f6
properly describe service definitions without class
This commit is contained in:
commit
8d7e002168
@ -220,7 +220,7 @@ class JsonDescriptor extends Descriptor
|
||||
'autoconfigure' => $definition->isAutoconfigured(),
|
||||
];
|
||||
|
||||
if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
|
||||
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
|
||||
$data['description'] = $classDescription;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ class MarkdownDescriptor extends Descriptor
|
||||
{
|
||||
$output = '';
|
||||
|
||||
if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
|
||||
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
|
||||
$output .= '- Description: `'.$classDescription.'`'."\n";
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,7 @@ class TextDescriptor extends Descriptor
|
||||
$options['output']->title(sprintf('Information for Service "<info>%s</info>"', $options['id']));
|
||||
}
|
||||
|
||||
if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
|
||||
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
|
||||
$options['output']->text($classDescription."\n");
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ class XmlDescriptor extends Descriptor
|
||||
$serviceXML->setAttribute('id', $id);
|
||||
}
|
||||
|
||||
if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
|
||||
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
|
||||
$serviceXML->appendChild($descriptionXML = $dom->createElement('description'));
|
||||
$descriptionXML->appendChild($dom->createCDATASection($classDescription));
|
||||
}
|
||||
|
@ -139,6 +139,7 @@ class ObjectsProvider
|
||||
->addTag('tag2')
|
||||
->addMethodCall('setMailer', [new Reference('mailer')])
|
||||
->setFactory([new Reference('factory.service'), 'get']),
|
||||
'definition_without_class' => new Definition(),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,19 @@
|
||||
"factory_method": "get",
|
||||
"tags": []
|
||||
},
|
||||
"definition_without_class": {
|
||||
"class": "",
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
"abstract": false,
|
||||
"autowire": false,
|
||||
"autoconfigure": false,
|
||||
"arguments": [],
|
||||
"file": null,
|
||||
"tags": []
|
||||
},
|
||||
"service_container": {
|
||||
"class": "Symfony\\Component\\DependencyInjection\\ContainerInterface",
|
||||
"public": true,
|
||||
|
@ -18,6 +18,18 @@ Definitions
|
||||
- Factory Class: `Full\Qualified\FactoryClass`
|
||||
- Factory Method: `get`
|
||||
|
||||
### definition_without_class
|
||||
|
||||
- Class: ``
|
||||
- Public: no
|
||||
- Synthetic: no
|
||||
- Lazy: no
|
||||
- Shared: yes
|
||||
- Abstract: no
|
||||
- Autowired: no
|
||||
- Autoconfigured: no
|
||||
- Arguments: no
|
||||
|
||||
### service_container
|
||||
|
||||
- Description: `ContainerInterface is the interface implemented by service container classes.`
|
||||
|
@ -2,11 +2,12 @@
|
||||
[33mSymfony Container Services[39m
|
||||
[33m==========================[39m
|
||||
|
||||
------------------- ----------------------------------------------------------
|
||||
[32m Service ID [39m [32m Class name [39m
|
||||
------------------- ----------------------------------------------------------
|
||||
alias_1 alias for "service_1"
|
||||
definition_1 Full\Qualified\Class1
|
||||
service_container Symfony\Component\DependencyInjection\ContainerInterface
|
||||
------------------- ----------------------------------------------------------
|
||||
-------------------------- ----------------------------------------------------------
|
||||
[32m Service ID [39m [32m Class name [39m
|
||||
-------------------------- ----------------------------------------------------------
|
||||
alias_1 alias for "service_1"
|
||||
definition_1 Full\Qualified\Class1
|
||||
definition_without_class
|
||||
service_container Symfony\Component\DependencyInjection\ContainerInterface
|
||||
-------------------------- ----------------------------------------------------------
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
<argument type="service" id=".definition_2"/>
|
||||
</argument>
|
||||
</definition>
|
||||
<definition id="definition_without_class" class="" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
<definition id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" public="true" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<description><![CDATA[ContainerInterface is the interface implemented by service container classes.]]></description>
|
||||
</definition>
|
||||
|
@ -14,6 +14,18 @@
|
||||
"factory_method": "get",
|
||||
"tags": []
|
||||
},
|
||||
"definition_without_class": {
|
||||
"class": "",
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
"abstract": false,
|
||||
"autowire": false,
|
||||
"autoconfigure": false,
|
||||
"file": null,
|
||||
"tags": []
|
||||
},
|
||||
"service_container": {
|
||||
"class": "Symfony\\Component\\DependencyInjection\\ContainerInterface",
|
||||
"public": true,
|
||||
|
@ -17,6 +17,17 @@ Definitions
|
||||
- Factory Class: `Full\Qualified\FactoryClass`
|
||||
- Factory Method: `get`
|
||||
|
||||
### definition_without_class
|
||||
|
||||
- Class: ``
|
||||
- Public: no
|
||||
- Synthetic: no
|
||||
- Lazy: no
|
||||
- Shared: yes
|
||||
- Abstract: no
|
||||
- Autowired: no
|
||||
- Autoconfigured: no
|
||||
|
||||
### service_container
|
||||
|
||||
- Description: `ContainerInterface is the interface implemented by service container classes.`
|
||||
|
@ -2,11 +2,12 @@
|
||||
[33mSymfony Container Services[39m
|
||||
[33m==========================[39m
|
||||
|
||||
------------------- ----------------------------------------------------------
|
||||
[32m Service ID [39m [32m Class name [39m
|
||||
------------------- ----------------------------------------------------------
|
||||
alias_1 alias for "service_1"
|
||||
definition_1 Full\Qualified\Class1
|
||||
service_container Symfony\Component\DependencyInjection\ContainerInterface
|
||||
------------------- ----------------------------------------------------------
|
||||
-------------------------- ----------------------------------------------------------
|
||||
[32m Service ID [39m [32m Class name [39m
|
||||
-------------------------- ----------------------------------------------------------
|
||||
alias_1 alias for "service_1"
|
||||
definition_1 Full\Qualified\Class1
|
||||
definition_without_class
|
||||
service_container Symfony\Component\DependencyInjection\ContainerInterface
|
||||
-------------------------- ----------------------------------------------------------
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
<definition id="definition_1" class="Full\Qualified\Class1" public="true" synthetic="false" lazy="true" shared="true" abstract="true" autowired="false" autoconfigured="false" file="">
|
||||
<factory class="Full\Qualified\FactoryClass" method="get"/>
|
||||
</definition>
|
||||
<definition id="definition_without_class" class="" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
||||
<definition id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" public="true" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file="">
|
||||
<description><![CDATA[ContainerInterface is the interface implemented by service container classes.]]></description>
|
||||
</definition>
|
||||
|
@ -0,0 +1,13 @@
|
||||
{
|
||||
"class": "",
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
"abstract": false,
|
||||
"autowire": false,
|
||||
"autoconfigure": false,
|
||||
"arguments": [],
|
||||
"file": null,
|
||||
"tags": []
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
- Class: ``
|
||||
- Public: no
|
||||
- Synthetic: no
|
||||
- Lazy: no
|
||||
- Shared: yes
|
||||
- Abstract: no
|
||||
- Autowired: no
|
||||
- Autoconfigured: no
|
||||
- Arguments: no
|
@ -0,0 +1,15 @@
|
||||
---------------- -------
|
||||
[32m Option [39m [32m Value [39m
|
||||
---------------- -------
|
||||
Service ID -
|
||||
Class -
|
||||
Tags -
|
||||
Public no
|
||||
Synthetic no
|
||||
Lazy no
|
||||
Shared yes
|
||||
Abstract no
|
||||
Autowired no
|
||||
Autoconfigured no
|
||||
---------------- -------
|
||||
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definition class="" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
@ -0,0 +1,12 @@
|
||||
{
|
||||
"class": "",
|
||||
"public": false,
|
||||
"synthetic": false,
|
||||
"lazy": false,
|
||||
"shared": true,
|
||||
"abstract": false,
|
||||
"autowire": false,
|
||||
"autoconfigure": false,
|
||||
"file": null,
|
||||
"tags": []
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
- Class: ``
|
||||
- Public: no
|
||||
- Synthetic: no
|
||||
- Lazy: no
|
||||
- Shared: yes
|
||||
- Abstract: no
|
||||
- Autowired: no
|
||||
- Autoconfigured: no
|
@ -0,0 +1,15 @@
|
||||
---------------- -------
|
||||
[32m Option [39m [32m Value [39m
|
||||
---------------- -------
|
||||
Service ID -
|
||||
Class -
|
||||
Tags -
|
||||
Public no
|
||||
Synthetic no
|
||||
Lazy no
|
||||
Shared yes
|
||||
Abstract no
|
||||
Autowired no
|
||||
Autoconfigured no
|
||||
---------------- -------
|
||||
|
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<definition class="" public="false" synthetic="false" lazy="false" shared="true" abstract="false" autowired="false" autoconfigured="false" file=""/>
|
Reference in New Issue
Block a user