8000 minor #21965 [DependencyInjection Remove duplicated code (GuilhemN) · symfony/symfony@dd7c727 · GitHub
[go: up one dir, main page]

Skip to content

Commit dd7c727

Browse files
committed
minor #21965 [DependencyInjection Remove duplicated code (GuilhemN)
This PR was merged into the 3.3-dev branch. Discussion ---------- [DependencyInjection Remove duplicated code | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- don't forget updating src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget updating UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Arrays are already supported by `YamlFileLoader::resolveServices()` so there's no need to duplicate code. Commits ------- 1bac3d7 [DependencyInjection Remove duplicated code
2 parents e57af1d + 1bac3d7 commit dd7c727

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ private function resolveServices($value)
666666
throw new InvalidArgumentException('"!iterator" tag only accepts sequences.');
667667
}
668668

669-
return new IteratorArgument(array_map(array($this, 'resolveServices'), $argument));
669+
return new IteratorArgument($this->resolveServices($argument));
670670
}
671671
if ('service_locator' === $value->getTag()) {
672672
if (!is_array($argument)) {
@@ -679,7 +679,7 @@ private function resolveServices($value)
679679
}
680680
}
681681

682-
return new ServiceLocatorArgument(array_map(array($this, 'resolveServices'), $argument));
682+
return new ServiceLocatorArgument($this->resolveServices($argument));
683683
}
684684
if ('closure_proxy' === $value->getTag()) {
685685
if (!is_array($argument) || array(0, 1) !== array_keys($argument) || !is_string($argument[0]) || !is_string($argument[1]) || 0 !== strpos($argument[0], '@') || 0 === strpos($argument[0], '@@')) {

0 commit comments

Comments
 (0)
0