|
@@ -24,27 +24,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
class ResolveInvalidReferencesPass implements CompilerPassInterface
|
|
class ResolveInvalidReferencesPass implements CompilerPassInterface
|
|
{
|
|
{
|
|
private $container;
|
|
private $container;
|
|
- private $exceptions;
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Constructor.
|
|
|
|
- *
|
|
|
|
- * @param array $exceptions An array of exceptions
|
|
|
|
- */
|
|
|
|
- public function __construct(array $exceptions = array('kernel', 'service_container', 'templating.loader.wrapped', 'pdo_connection'))
|
|
|
|
- {
|
|
|
|
- $this->exceptions = $exceptions;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Add an exception.
|
|
|
|
- *
|
|
|
|
- * @param string $id Exception identifier
|
|
|
|
- */
|
|
|
|
- public function addException($id)
|
|
|
|
- {
|
|
|
|
- $this->exceptions[] = $id;
|
|
|
|
- }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* Process the ContainerBuilder to resolve invalid references.
|
|
* Process the ContainerBuilder to resolve invalid references.
|
|
@@ -100,10 +79,6 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
|
|
} else if ($argument instanceof Reference) {
|
|
} else if ($argument instanceof Reference) {
|
|
$id = (string) $argument;
|
|
$id = (string) $argument;
|
|
|
|
|
|
- if (in_array($id, $this->exceptions, true)) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
$invalidBehavior = $argument->getInvalidBehavior();
|
|
$invalidBehavior = $argument->getInvalidBehavior();
|
|
$exists = $this->container->has($id);
|
|
$exists = $this->container->has($id);
|
|
|
|
|
|
@@ -124,4 +99,4 @@ class ResolveInvalidReferencesPass implements CompilerPassInterface
|
|
|
|
|
|
return $arguments;
|
|
return $arguments;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|