8000 declare types in array_map callbacks · symfony/symfony@e7d5634 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7d5634

Browse files
DQNEOfabpot
authored andcommitted
declare types in array_map callbacks
1 parent 9a0422c commit e7d5634

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php

Lines changed: 2 additions & 1 deletion
< 8000 div data-testid="neutral diffstat" class="DiffSquares-module__diffSquare--h5kjy DiffSquares-module__neutral--VlyoP">
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Definition;
1818
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
19+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1920
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
2021
use Symfony\Component\ExpressionLanguage\Expression;
2122

@@ -44,7 +45,7 @@ public function __construct(ContainerBuilder $container, PhpFileLoader $loader,
4445
final public function extension($namespace, array $config)
4546
{
4647
if (!$this->container->hasExtension($namespace)) {
47-
$extensions = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
48+
$extensions = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
4849
throw new InvalidArgumentException(sprintf(
4950
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
5051
$namespace,

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
16+
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Component\DependencyInjection\Reference;
1819
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@@ -788,7 +789,7 @@ public function testBindings()
788789
'$foo' => array(null),
789790
'$quz' => 'quz',
790791
'$factory' => 'factory',
791-
), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings()));
792+
), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
792793
$this->assertEquals(array(
793794
'quz',
794795
null,
@@ -805,6 +806,6 @@ public function testBindings()
805806
'NonExistent' => null,
806807
'$quz' => 'quz',
807808
'$factory' => 'factory',
808-
), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings()));
809+
), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
809810
}
810811
}

src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\DependencyInjection\Tests\Loader;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\Argument\BoundArgument;
1516
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Component\DependencyInjection\Reference;
@@ -713,7 +714,7 @@ public function testBindings()
713714
'$foo' => array(null),
714715
'$quz' => 'quz',
715716
'$factory' => 'factory',
716-
), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings()));
717+
), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
717718
$this->assertEquals(array(
718719
'quz',
719720
null,
@@ -730,6 +731,6 @@ public function testBindings()
730731
'NonExistent' => null,
731732
'$quz' => 'quz',
732733
'$factory' => 'factory',
733-
), array_map(function ($v) { return $v->getValues()[0]; }, $definition->getBindings()));
734+
), array_map(function (BoundArgument $v) { return $v->getValues()[0]; }, $definition->getBindings()));
734735
}
735736
}

0 commit comments

Comments
 (0)
0