Process the ContainerBuilder to resolve invalid references.
ContainerBuilder $container:
Overrides CompilerPassInterface::process
public function process(ContainerBuilder $container) {
$this->container = $container;
foreach ($container
->getDefinitions() as $definition) {
if ($definition
->isSynthetic() || $definition
->isAbstract()) {
continue;
}
$definition
->setArguments($this
->processArguments($definition
->getArguments()));
$calls = array();
foreach ($definition
->getMethodCalls() as $call) {
try {
$calls[] = array(
$call[0],
$this
->processArguments($call[1], true),
);
} catch (RuntimeException $ignore) {
// this call is simply removed
}
}
$definition
->setMethodCalls($calls);
$properties = array();
foreach ($definition
->getProperties() as $name => $value) {
try {
$value = $this
->processArguments(array(
$value,
), true);
$properties[$name] = reset($value);
} catch (RuntimeException $ignore) {
// ignore property
}
}
$definition
->setProperties($properties);
}
}