Skip to content
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 @@ -242,6 +242,14 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
}
}

$calls = $definition->getMethodCalls();
if (count($calls) > 0) {
$data['calls'] = array();
foreach ($calls as $callData) {
$data['calls'][] = $callData[0];
}
}

if (!$omitTags) {
$data['tags'] = array();
if (count($definition->getTags())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ protected function describeContainerDefinition(Definition $definition, array $op
}
}

$calls = $definition->getMethodCalls();
foreach ($calls as $callData) {
$output .= "\n".'- Call: `'.$callData[0].'`';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo this should be "Calls" do be consistent with the other descriptors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we already using the same thing for Tag and Autowiring Type and if we use Calls we should list them in the same row, did you see how it looks ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you are right. This indeed looks right the way it is.

}

if (!(isset($options['omit_tags']) && $options['omit_tags'])) {
foreach ($definition->getTags() as $tagName => $tagData) {
foreach ($tagData as $parameters) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ protected function describeContainerDefinition(Definition $definition, array $op
}
$tableRows[] = array('Tags', $tagInformation);

$calls = $definition->getMethodCalls();
if (count($calls) > 0) {
$callInformation = [];
foreach ($calls as $call) {
$callInformation[] = $call[0];
}
$tableRows[] = array('Calls', implode(', ', $callInformation));
}

$tableRows[] = array('Public', $definition->isPublic() ? 'yes' : 'no');
$tableRows[] = array('Synthetic', $definition->isSynthetic() ? 'yes' : 'no');
$tableRows[] = array('Lazy', $definition->isLazy() ? 'yes' : 'no');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,15 @@ private function getContainerDefinitionDocument(Definition $definition, $id = nu

$serviceXML->setAttribute('file', $definition->getFile());

$calls = $definition->getMethodCalls();
if (count($calls) > 0) {
$serviceXML->appendChild($callsXML = $dom->createElement('calls'));
foreach ($calls as $callData) {
$callsXML->appendChild($callXML = $dom->createElement('call'));
$callXML->setAttribute('method', $callData[0]);
}
}

if (!$omitTags) {
$tags = $definition->getTags();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static function getContainerDefinitions()
->addTag('tag1', array('attr1' => 'val1', 'attr2' => 'val2'))
->addTag('tag1', array('attr3' => 'val3'))
->addTag('tag2')
->addMethodCall('setMailer', array(new Reference('mailer')))
->setFactory(array(new Reference('factory.service'), 'get')),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
]
}
],
"calls": [
"setMailer"
],
"autowire": false,
"autowiring_types": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ definition_2
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
- Call: `setMailer`
- Tag: `tag1`
- Attr1: val1
- Attr2: val2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
</definition>
<definition id="definition_2" class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<calls>
<call method="setMailer"/>
</calls>
<tags>
<tag name="tag1">
<parameter name="attr1">val1</parameter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
]
}
],
"calls": [
"setMailer"
],
"autowire": false,
"autowiring_types": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ definition_2
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
- Call: `setMailer`
- Tag: `tag1`
- Attr1: val1
- Attr2: val2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<container>
<definition id="definition_2" class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<calls>
<call method="setMailer"/>
</calls>
<tags>
<tag name="tag1">
<parameter name="attr1">val1</parameter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"shared": true,
"abstract": false,
"file": "\/path\/to\/file",
"calls": [
"setMailer"
],
"factory_service": "factory.service",
"factory_method": "get",
"autowire": false,
Expand All @@ -23,6 +26,9 @@
"shared": true,
"abstract": false,
"file": "\/path\/to\/file",
"calls": [
"setMailer"
],
"factory_service": "factory.service",
"factory_method": "get",
"autowire": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ definition_2
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
- Call: `setMailer`


tag2
Expand All @@ -35,3 +36,4 @@ definition_2
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
- Call: `setMailer`
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
<tag name="tag1">
<definition id="definition_2" class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<calls>
<call method="setMailer"/>
</calls>
</definition>
</tag>
<tag name="tag2">
<definition id="definition_2" class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<calls>
<call method="setMailer"/>
</calls>
</definition>
</tag>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
]
}
],
"calls": [
"setMailer"
],
"autowire": false,
"autowiring_types": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
- File: `/path/to/file`
- Factory Service: `factory.service`
- Factory Method: `get`
- Call: `setMailer`
- Tag: `tag1`
- Attr1: val1
- Attr2: val2
- Tag: `tag1`
- Attr3: val3
- Tag: `tag2`
- Tag: `tag2`
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Service ID -
Class Full\Qualified\Class2
Tags tag1 (attr1: val1, attr2: val2)tag1 (attr3: val3)tag2
Calls setMailer
Public no
Synthetic yes
Lazy no
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<definition class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file">
<factory service="factory.service" method="get"/>
<calls>
<call method="setMailer"/>
</calls>
<tags>
<tag name="tag1">
<parameter name="attr1">val1</parameter>
Expand Down