Skip to content

Commit 67c8a1a

Browse files
authored
Merge pull request #49 from ruudk/class-name-services
Use `serviceId` and `method` in callable
2 parents c64bf74 + 57fcad6 commit 67c8a1a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/DependencyInjection/Compiler/RegisterHandlers.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public function process(ContainerBuilder $container)
4747
$this->keyAttribute,
4848
function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
4949
if (isset($tagAttributes['method'])) {
50-
$callable = [$serviceId, $tagAttributes['method']];
50+
// Symfony 3.3 supports services by classname. This interferes with `is_callable`
51+
// in `ServiceLocatorAwareCallableResolver`
52+
$callable = [
53+
'serviceId' => $serviceId,
54+
'method' => $tagAttributes['method'],
55+
];
5156
} else {
5257
$callable = $serviceId;
5358
}

src/DependencyInjection/Compiler/RegisterSubscribers.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public function process(ContainerBuilder $container)
4747
$this->keyAttribute,
4848
function ($key, $serviceId, array $tagAttributes) use (&$handlers) {
4949
if (isset($tagAttributes['method'])) {
50-
$callable = [$serviceId, $tagAttributes['method']];
50+
// Symfony 3.3 supports services by classname. This interferes with `is_callable`
51+
// in `ServiceLocatorAwareCallableResolver`
52+
$callable = [
53+
'serviceId' => $serviceId,
54+
'method' => $tagAttributes['method'],
55+
];
5156
} else {
5257
$callable = $serviceId;
5358
}

0 commit comments

Comments
 (0)