diff --git a/src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php b/src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php index 22fc92727a..8ea04119d8 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php +++ b/src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php @@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\ExpressionLanguage\Expression; @@ -45,7 +46,7 @@ class ContainerConfigurator extends AbstractConfigurator final public function extension(string $namespace, array $config) { if (!$this->container->hasExtension($namespace)) { - $extensions = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions())); + $extensions = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions())); throw new InvalidArgumentException(sprintf( 'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s', $namespace, diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index fb80cd4936..7e0ce38719 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -13,6 +13,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; +use Symfony\Component\DependencyInjection\Argument\BoundArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; @@ -776,7 +777,7 @@ class XmlFileLoaderTest extends TestCase '$foo' => array(null), '$quz' => 'quz', '$factory' => 'factory', - ), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings())); + ), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings())); $this->assertEquals(array( 'quz', null, @@ -793,6 +794,6 @@ class XmlFileLoaderTest extends TestCase 'NonExistent' => null, '$quz' => 'quz', '$factory' => 'factory', - ), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings())); + ), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings())); } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php index ac11c92ffa..8ddc15f888 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\Argument\BoundArgument; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; @@ -719,7 +720,7 @@ class YamlFileLoaderTest extends TestCase '$foo' => array(null), '$quz' => 'quz', '$factory' => 'factory', - ), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings())); + ), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings())); $this->assertEquals(array( 'quz', null, @@ -736,6 +737,6 @@ class YamlFileLoaderTest extends TestCase 'NonExistent' => null, '$quz' => 'quz', '$factory' => 'factory', - ), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings())); + ), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings())); } }