8000 [FrameworkBundle] properly describe service definitions without class by xabbuh · Pull Request #30641 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] properly describe service definitions without class #30641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private function getContainerDefinitionData(Definition $definition, bool $omitTa
'autoconfigure' => $definition->isAutoconfigured(),
];

if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
$data['description'] = $classDescription;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
{
$output = '';

if ('' !== $classDescription = $this->getClassDescription($definition->getClass())) {
if ('' !== $classDescription = $this->getClassDescription((string) $definition->getClass())) {
$output .= '- Description: `'.$classDescription.'`'."\n";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
$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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private function getContainerDefinitionDocument(Definition $definition, string $
$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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public static function getContainerDefinitions()
->addTag 8000 ('tag2')
->addMethodCall('setMailer', [new Reference('mailer')])
->setFactory([new Reference('factory.service'), 'get']),
'definition_without_class' => new Definition(),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
Symfony Container Services
==========================

------------------- ----------------------------------------------------------
 Service ID   Class name 
------------------- ----------------------------------------------------------
alias_1 alias for "service_1"
definition_1 Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerInterface
------------------- ----------------------------------------------------------
-------------------------- ----------------------------------------------------------
 Service ID   Class name 
-------------------------- ----------------------------------------------------------
alias_1 alias for "service_1"
definition_1 Full\Qualified\Class1
definition_without_class
service_container Symfony\Component\DependencyInjection\ContainerInterface
-------------------------- ----------------------------------------------------------

Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
Symfony Container Services
==========================

------------------- ----------------------------------------------------------
 Service ID   Class name 
------------------- ----------------------------------------------------------
alias_1 alias for "service_1"
definition_1 Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerInterface
------------------- ----------------------------------------------------------
-------------------------- ----------------------------------------------------------
 Service ID   Class name 
-------------------------- ----------------------------------------------------------
alias_1 alias for "service_1"
definition_1 Full\Qualified\Class1
definition_without_class
service_container Symfony\Component\DependencyInjection\ContainerInterface
-------------------------- ----------------------------------------------------------

Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"class": "",
"public": false,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": false,
"autoconfigure": false,
"arguments": [],
"file": null,
"tags": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- Class: ``
- Public: no
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowired: no
- Autoconfigured: no
- Arguments: no
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---------------- -------
 Option   Value 
---------------- -------
Service ID -
Class -
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired no
Autoconfigured no
---------------- -------

Original file line number Diff line number Diff line change
@@ -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=""/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"class": "",
"public": false,
"synthetic": false,
"lazy": false,
"shared": true,
"abstract": false,
"autowire": false,
"autoconfigure": false,
"file": null,
"tags": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Class: ``
- Public: no
- Synthetic: no
- Lazy: no
- Shared: yes
- Abstract: no
- Autowired: no
- Autoconfigured: no
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---------------- -------
 Option   Value 
---------------- -------
Service ID -
Class -
Tags -
Public no
Synthetic no
Lazy no
Shared yes
Abstract no
Autowired no
Autoconfigured no
---------------- -------

Original file line number Diff line number Diff line change
@@ -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