Skip to content

Commit 4cf9699

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Fix colors for 4.4 Stand with Ukraine [Runtime] Fix passing $debug parameter to `ErrorHandler` [FrameworkBundle] Ensure container is reset between tests [HttpKernel] fix using Target with controller args Remove blocking test for adding support for placeholders in EmumNode in 6.1 [FrameworkBundle] Fix compiler passes processing a container twice when it's loaded from the debug dump [HttpKernel] Fix advertizing deprecations for *TestSessionListener
2 parents ca8dcdf + aa5ddc5 commit 4cf9699

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CHANGELOG
1414
---
1515

1616
* Add the ability to enable the profiler using a request query parameter, body parameter or attribute
17-
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
17+
* Deprecate `AbstractTestSessionListener` and `TestSessionListener`, use `AbstractSessionListener` and `SessionListener` instead
1818
* Deprecate the `fileLinkFormat` parameter of `DebugHandlersListener`
1919
* Add support for configuring log level, and status code by exception class
2020
* Allow ignoring "kernel.reset" methods that don't exist with "on_invalid" attribute

DependencyInjection/RegisterControllerArgumentLocatorsPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function process(ContainerBuilder $container)
175175
$args[$p->name] = new Reference($erroredId, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE);
176176
} else {
177177
$target = ltrim($target, '\\');
178-
$args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior, $p->name) : new Reference($target, $invalidBehavior);
178+
$args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior, Target::parseName($p)) : new Reference($target, $invalidBehavior);
179179
}
180180
}
181181
// register the maps as a per-method service-locators

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ public function testBindWithTarget()
425425
$container = new ContainerBuilder();
426426
$resolver = $container->register('argument_resolver.service')->addArgument([]);
427427

428+
$container->register(ControllerDummy::class, 'bar');
429+
$container->register(ControllerDummy::class.' $imageStorage', 'baz');
430+
428431
$container->register('foo', WithTarget::class)
429432
->setBindings(['string $someApiKey' => new Reference('the_api_key')])
430433
->addTag('controller.service_arguments');
@@ -434,7 +437,11 @@ public function testBindWithTarget()
434437
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
435438
$locator = $container->getDefinition((string) $locator['foo::fooAction']->getValues()[0]);
436439

437-
$expected = ['apiKey' => new ServiceClosureArgument(new Reference('the_api_key'))];
440+
$expected = [
441+
'apiKey' => new ServiceClosureArgument(new Reference('the_api_key')),
442+
'service1' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'imageStorage')),
443+
'service2' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'service2')),
444+
];
438445
$this->assertEquals($expected, $locator->getArgument(0));
439446
}
440447
}
@@ -510,7 +517,10 @@ class WithTarget
510517
{
511518
public function fooAction(
512519
#[Target('some.api.key')]
513-
string $apiKey
520+
string $apiKey,
521+
#[Target('image.storage')]
522+
ControllerDummy $service1,
523+
ControllerDummy $service2
514524
) {
515525
}
516526
}

0 commit comments

Comments
 (0)