Skip to content

Commit 7cd80c4

Browse files
Merge branch '4.4'
* 4.4: Re-allow to use "tagged" in service definitions [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() Add missing lock connection string in FrameworkExtension [DomCrawler] normalizeWhitespace should be true by default [DoctrineBridge] Auto-validation must work if no regex are passed Allows URL DSN in Lock and Cache
2 parents 5cf603c + 91f0862 commit 7cd80c4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

DependencyInjection/AddAutoMappingConfigurationPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public function process(ContainerBuilder $container)
5959
$validatorBuilder = $container->getDefinition($this->validatorBuilderService);
6060
foreach ($container->findTaggedServiceIds($this->tag) as $id => $tags) {
6161
$regexp = $this->getRegexp(array_merge($globalNamespaces, $servicesToNamespaces[$id] ?? []));
62+
if (null === $regexp) {
63+
$container->removeDefinition($id);
64+
continue;
65+
}
6266

6367
$container->getDefinition($id)->setArgument('$classValidatorRegexp', $regexp);
6468
$validatorBuilder->addMethodCall('addLoader', [new Reference($id)]);

Tests/DependencyInjection/AddAutoMappingConfigurationPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ public function testDoNotMapAllClassesWhenConfigIsEmpty()
8181

8282
(new AddAutoMappingConfigurationPass())->process($container);
8383

84-
$this->assertNull($container->getDefinition('loader')->getArgument('$classValidatorRegexp'));
84+
$this->assertFalse($container->hasDefinition('loader'));
8585
}
8686
}

0 commit comments

Comments
 (0)