8000 [Di] Remove closure-proxy arguments · symfony/symfony@57daadb · GitHub
[go: up one dir, main page]

Skip to content

Commit 57daadb

Browse files
[Di] Remove closure-proxy arguments
1 parent 3fc1189 commit 57daadb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+30
-733
lines changed

UPGRADE-3.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ EventDispatcher
127127
---------------
128128

129129
* The `ContainerAwareEventDispatcher` class has been deprecated.
130-
Use `EventDispatcher` with closure-proxy injection instead.
130+
Use `EventDispatcher` with closure factories instead.
131131

132132
Finder
133133
------

UPGRADE-4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ EventDispatcher
132132
---------------
133133

134134
* The `ContainerAwareEventDispatcher` class has been removed.
135-
Use `EventDispatcher` with closure-proxy injection instead.
135+
Use `EventDispatcher` with closure factories instead.
136136

137137
ExpressionLanguage
138138
------------------

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ protected function formatClosure(\Closure $closure)
312312
{
313313
$r = new \ReflectionFunction($closure);
314314

315-
if (preg_match('#^/\*\* @closure-proxy ([^: ]++)::([^: ]++) \*/$#', $r->getDocComment(), $m)) {
316-
return sprintf('%s::%s', $m[1], $m[2]);
317-
}
318-
319315
return 'closure';
320316
}
321317
}

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Console\Helper\Table;
1515
use Symfony\Component\Console\Style\SymfonyStyle;
1616
use Symfony\Component\DependencyInjection\Alias;
17-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1817
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1918
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -343,9 +342,6 @@ protected function describeContainerDefinition(Definition $definition, array $op
343342
$argumentsInformation[] = sprintf('Service(%s)', (string) $argument);
344343
} elseif ($argument instanceof IteratorArgument) {
345344
$argumentsInformation[] = sprintf('Iterator (%d element(s))', count($argument->getValues()));
346-
} elseif ($argument instanceof ClosureProxyArgument) {
347-
list($reference, $method) = $argument->getValues();
348-
$argumentsInformation[] = sprintf('ClosureProxy(Service(%s)::%s())', $reference, $method);
349345
} elseif ($argument instanceof Definition) {
350346
$argumentsInformation[] = 'Inlined Service';
351347
} else {

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
1313

1414
use Symfony\Component\DependencyInjection\Alias;
15-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
1817
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -444,11 +443,6 @@ private function getArgumentNodes(array $arguments, \DOMDocument $dom)
444443
foreach ($this->getArgumentNodes($argument->getValues(), $dom) as $childArgumentXML) {
445444
$argumentXML->appendChild($childArgumentXML);
446445
}
447-
} elseif ($argument instanceof ClosureProxyArgument) {
448-
list($reference, $method) = $argument->getValues();
449-
$argumentXML->setAttribute('type', 'closure-proxy');
450-
$argumentXML->setAttribute('id', (string) $reference);
451-
$argumentXML->setAttribute('method', $method);
452446
} elseif ($argument instanceof Definition) {
453447
$argumentXML->appendChild($dom->importNode($this->getContainerDefinitionDocument($argument, null, false, true)->childNodes->item(0), true));
454448
} elseif (is_array($argument)) {

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor;
1313

1414
use Symfony\Component\DependencyInjection\Alias;
15-
use Symfony\Component\DependencyInjection\Argument\ClosureProxyArgument;
1615
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1716
use Symfony\Component\DependencyInjection\ContainerBuilder;
1817
use Symfony\Component\DependencyInjection\Definition;
@@ -119,7 +118,6 @@ public static function getContainerDefinitions()
119118
new Reference('definition_1'),
120119
new Reference('definition_2'),
121120
)))
122-
->addArgument(new ClosureProxyArgument('definition1', 'get'))
123121
->setFactory(array('Full\\Qualified\\FactoryClass', 'get')),
124122
'definition_2' => $definition2
125123
->setPublic(false)

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@
6060
"type": "service",
6161
"id": "definition_2"
6262
}
63-
],
64-
[
65-
{
66-
"type": "service",
67-
"id": "definition1"
68-
},
69-
"get"
7063
]
7164
],
7265
"file": null,

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<argument type="service" id="definition_1"/>
2323
<argument type="service" id="definition_2"/>
2424
</argument>
25-
<argument type="closure-proxy" id="definition1" method="get"/>
2625
</definition>
2726
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/>
2827
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@
5858
"type": "service",
5959
"id": "definition_2"
6060
}
61-
],
62-
[
63-
{
64-
"type": "service",
65-
"id": "definition1"
66-
},
67-
"get"
6861
]
6962
],
7063
"file": null,
Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
---------------- -------------------------------------------
2-
 Option   Value 
3-
---------------- -------------------------------------------
4-
Service ID -
5-
Class Full\Qualified\Class1
6-
Tags -
7-
Public yes
8-
Synthetic no
9-
Lazy yes
10-
Shared yes
11-
Abstract yes
12-
Autowired no
13-
Autoconfigured no
14-
Factory Class Full\Qualified\FactoryClass
15-
Factory Method get
16-
 Arguments Service(definition2) 
17-
 %parameter% 
18-
 Inlined Service 
19-
 Array (3 element(s)) 
20-
 Iterator (2 element(s)) 
21-
 ClosureProxy(Service(definition1)::get())
22-
---------------- -------------------------------------------
1+
---------------- -----------------------------
2+
 Option   Value 
3+
---------------- -----------------------------
4+
Service ID -
5+
Class Full\Qualified\Class1
6+
Tags -
7+
Public yes
8+
Synthetic no
9+
Lazy yes
10+
Shared yes
11+
Abstract yes
12+
Autowired no
13+
Autoconfigured no
14+
Factory Class Full\Qualified\FactoryClass
15+
Factory Method get
16+
 Arguments Service(definition2) 
17+
 %parameter% 
18+
 Inlined Service 
19+
 Array (3 element(s)) 
20+
 Iterator (2 element(s))
21+
---------------- -----------------------------
2322

0 commit comments

Comments
 (0)
0