mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
⬆️ N°4770 Update to latest Symfony 3.4
This commit is contained in:
@@ -24,10 +24,12 @@ class ResolveParameterPlaceHoldersPass extends AbstractRecursivePass
|
||||
{
|
||||
private $bag;
|
||||
private $resolveArrays;
|
||||
private $throwOnResolveException;
|
||||
|
||||
public function __construct($resolveArrays = true)
|
||||
public function __construct($resolveArrays = true, $throwOnResolveException = true)
|
||||
{
|
||||
$this->resolveArrays = $resolveArrays;
|
||||
$this->throwOnResolveException = $throwOnResolveException;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +63,16 @@ class ResolveParameterPlaceHoldersPass extends AbstractRecursivePass
|
||||
protected function processValue($value, $isRoot = false)
|
||||
{
|
||||
if (\is_string($value)) {
|
||||
$v = $this->bag->resolveValue($value);
|
||||
try {
|
||||
$v = $this->bag->resolveValue($value);
|
||||
} catch (ParameterNotFoundException $e) {
|
||||
if ($this->throwOnResolveException) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$v = null;
|
||||
$this->container->getDefinition($this->currentId)->addError($e->getMessage());
|
||||
}
|
||||
|
||||
return $this->resolveArrays || !$v || !\is_array($v) ? $v : $value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user