Skip to content

Commit 8f33bdc

Browse files
DQNEOfabpot
authored andcommitted
declare type for arguments of anonymous functions for v2.7
1 parent c82be55 commit 8f33bdc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Loader/XmlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Component\DependencyInjection\Reference;
2424
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2525
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
26+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
2627
use Symfony\Component\ExpressionLanguage\Expression;
2728

2829
/**
@@ -667,7 +668,7 @@ private function validateExtensions(\DOMDocument $dom, $file)
667668

668669
// can it be handled by an extension?
669670
if (!$this->container->hasExtension($node->namespaceURI)) {
670-
$extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
671+
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
671672
throw new InvalidArgumentException(sprintf(
672673
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
673674
$node->tagName,

Loader/YamlFileLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Component\DependencyInjection\Reference;
2424
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
2525
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
26+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
2627
use Symfony\Component\Yaml\Exception\ParseException;
2728
use Symfony\Component\Yaml\Parser as YamlParser;
2829
use Symfony\Component\Yaml\Tag\TaggedValue;
@@ -652,7 +653,7 @@ private function validate($content, $file)
652653
}
653654

654655
if (!$this->container->hasExtension($namespace)) {
655-
$extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
656+
$extensionNamespaces = array_filter(array_map(function (ExtensionInterface $ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
656657
throw new InvalidArgumentException(sprintf(
657658
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
658659
$namespace,

0 commit comments

Comments
 (0)