Merge branch '3.4' into 4.0
* 3.4: [HttpKernel] Fix merging bindings for controllers' locators bumped Symfony version to 3.4.14 updated VERSION for 3.4.13 updated CHANGELOG for 3.4.13 bumped Symfony version to 2.8.44
This commit is contained in:
commit
097ac83a50
|
@ -60,7 +60,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
|||
while ($def instanceof ChildDefinition) {
|
||||
$def = $container->findDefinition($def->getParent());
|
||||
$class = $class ?: $def->getClass();
|
||||
$bindings = $def->getBindings();
|
||||
$bindings += $def->getBindings();
|
||||
}
|
||||
$class = $parameterBag->resolveValue($class);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
|
|||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
|
||||
use Symfony\Component\DependencyInjection\ChildDefinition;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
@ -326,6 +327,29 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
|
|||
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
|
||||
$this->assertEmpty($locator);
|
||||
}
|
||||
|
||||
public function testBindingsOnChildDefinitions()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$resolver = $container->register('argument_resolver.service')->addArgument(array());
|
||||
|
||||
$container->register('parent', ArgumentWithoutTypeController::class);
|
||||
|
||||
$container->setDefinition('child', (new ChildDefinition('parent'))
|
||||
->setBindings(array('$someArg' => new Reference('parent')))
|
||||
->addTag('controller.service_arguments')
|
||||
);
|
||||
|
||||
$pass = new RegisterControllerArgumentLocatorsPass();
|
||||
$pass->process($container);
|
||||
|
||||
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
|
||||
$this->assertInstanceOf(ServiceClosureArgument::class, $locator['child:fooAction']);
|
||||
|
||||
$locator = $container->getDefinition((string) $locator['child:fooAction']->getValues()[0])->getArgument(0);
|
||||
$this->assertInstanceOf(ServiceClosureArgument::class, $locator['someArg']);
|
||||
$this->assertEquals(new Reference('parent'), $locator['someArg']->getValues()[0]);
|
||||
}
|
||||
}
|
||||
|
||||
class RegisterTestController
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"symfony/config": "~3.4|~4.0",
|
||||
"symfony/console": "~3.4|~4.0",
|
||||
"symfony/css-selector": "~3.4|~4.0",
|
||||
"symfony/dependency-injection": "^3.4.5|^4.0.5",
|
||||
"symfony/dependency-injection": "^3.4.10|^4.0.10",
|
||||
"symfony/dom-crawler": "~3.4|~4.0",
|
||||
"symfony/expression-language": "~3.4|~4.0",
|
||||
"symfony/finder": "~3.4|~4.0",
|
||||
|
@ -45,7 +45,7 @@
|
|||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<3.4",
|
||||
"symfony/dependency-injection": "<3.4.5|<4.0.5,>=4",
|
||||
"symfony/dependency-injection": "<3.4.10|<4.0.10,>=4",
|
||||
"symfony/var-dumper": "<3.4",
|
||||
"twig/twig": "<1.34|<2.4,>=2"
|
||||
},
|
||||
|
|
Reference in New Issue