Skip to content

Commit aac04f3

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: 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 reflect Cache component version dependent default value in test 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 0a62931 + 4cf9699 commit aac04f3

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
@@ -22,7 +22,7 @@ CHANGELOG
2222
---
2323

2424
* Add the ability to enable the profiler using a request query parameter, body parameter or attribute
25-
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
25+
* Deprecate `AbstractTestSessionListener` and `TestSessionListener`, use `AbstractSessionListener` and `SessionListener` instead
2626
* Deprecate the `fileLinkFormat` parameter of `DebugHandlersListener`
2727
* Add support for configuring log level, and status code by exception class
2828
* 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
@@ -422,6 +422,9 @@ public function testBindWithTarget()
422422
$container = new ContainerBuilder();
423423
$resolver = $container->register('argument_resolver.service')->addArgument([]);
424424

425+
$container->register(ControllerDummy::class, 'bar');
426+
$container->register(ControllerDummy::class.' $imageStorage', 'baz');
427+
425428
$container->register('foo', WithTarget::class)
426429
->setBindings(['string $someApiKey' => new Reference('the_api_key')])
427430
->addTag('controller.service_arguments');
@@ -431,7 +434,11 @@ public function testBindWithTarget()
431434
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
432435
$locator = $container->getDefinition((string) $locator['foo::fooAction']->getValues()[0]);
433436

434-
$expected = ['apiKey' => new ServiceClosureArgument(new Reference('the_api_key'))];
437+
$expected = [
438+
'apiKey' => new ServiceClosureArgument(new Reference('the_api_key')),
439+
'service1' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'imageStorage')),
440+
'service2' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'service2')),
441+
];
435442
$this->assertEquals($expected, $locator->getArgument(0));
436443
}
437444
}
@@ -507,7 +514,10 @@ class WithTarget
507514
{
508515
public function fooAction(
509516
#[Target('some.api.key')]
510-
string $apiKey
517+
string $apiKey,
518+
#[Target('image.storage')]
519+
ControllerDummy $service1,
520+
ControllerDummy $service2
511521
) {
512522
}
513523
}

0 commit comments

Comments
 (0)