diff --git a/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Fixture/skip_excluded_tag.php.inc b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Fixture/skip_excluded_tag.php.inc new file mode 100644 index 00000000..bd958fc2 --- /dev/null +++ b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Fixture/skip_excluded_tag.php.inc @@ -0,0 +1,12 @@ +services(); + + $services->set('excluded', ExcludedService::class); +}; diff --git a/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Source/ExcludedService.php b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Source/ExcludedService.php new file mode 100644 index 00000000..1446bb3e --- /dev/null +++ b/rules-tests/Configs/Rector/Closure/ServiceSetStringNameToClassNameRector/Source/ExcludedService.php @@ -0,0 +1,9 @@ + + + + diff --git a/src/ValueObjectFactory/ServiceMapFactory.php b/src/ValueObjectFactory/ServiceMapFactory.php index 76ea7096..c110bbbd 100644 --- a/src/ValueObjectFactory/ServiceMapFactory.php +++ b/src/ValueObjectFactory/ServiceMapFactory.php @@ -47,6 +47,10 @@ public function createFromFileContent(string $configFilePath): ServiceMap $def = $this->convertXmlToArray($def); $tags = $this->createTagFromXmlElement($def); + if (in_array('container.excluded', array_column($tags, 'name'), true)) { + continue; + } + $service = $this->createServiceFromXmlAndTagsData($attrs, $tags); if ($service->getAlias() !== null) { $aliases[] = $service;