We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e356a65 commit 400acf6Copy full SHA for 400acf6
1 file changed
src/DependencyInjection/ConditionalTagsExtension.php
@@ -11,7 +11,11 @@ public function beforeCompile(): void
11
$builder = $this->getContainerBuilder();
12
13
foreach ($config as $type => $tags) {
14
- foreach ($builder->findByType($type) as $service) {
+ $services = $builder->findByType($type);
15
+ if (count($services) === 0) {
16
+ throw new \PHPStan\ShouldNotHappenException(sprintf('No services of type "%s" found.', $type));
17
+ }
18
+ foreach ($services as $service) {
19
foreach ($tags as $tag => $parameter) {
20
if ((bool) $parameter) {
21
$service->addTag($tag);
0 commit comments