mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9319 increase php min. version to 8.2 (#887)
* Update minimum PHP version to 8.2 * Fix previous wrong resolution of merge conflict
This commit is contained in:
@@ -77,6 +77,18 @@ abstract class AbstractConfigurator
|
||||
$value = (self::$valuePreProcessor)($value, $allowServices);
|
||||
}
|
||||
|
||||
if ($value instanceof ParamConfigurator) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
if (\is_scalar($value ?? '') || $value instanceof \UnitEnum) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if (!$allowServices) {
|
||||
throw new InvalidArgumentException(\sprintf('Cannot use values of type "%s" in service configuration files.', get_debug_type($value)));
|
||||
}
|
||||
|
||||
if ($value instanceof ReferenceConfigurator) {
|
||||
$reference = new Reference($value->id, $value->invalidBehavior);
|
||||
|
||||
@@ -90,29 +102,18 @@ abstract class AbstractConfigurator
|
||||
return $def;
|
||||
}
|
||||
|
||||
if ($value instanceof ParamConfigurator) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
if ($value instanceof self) {
|
||||
throw new InvalidArgumentException(\sprintf('"%s()" can be used only at the root of service configuration files.', $value::FACTORY));
|
||||
}
|
||||
|
||||
switch (true) {
|
||||
case null === $value:
|
||||
case \is_scalar($value):
|
||||
case $value instanceof \UnitEnum:
|
||||
return $value;
|
||||
|
||||
case $value instanceof ArgumentInterface:
|
||||
case $value instanceof Definition:
|
||||
case $value instanceof Expression:
|
||||
case $value instanceof Parameter:
|
||||
case $value instanceof AbstractArgument:
|
||||
case $value instanceof Reference:
|
||||
if ($allowServices) {
|
||||
return $value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException(\sprintf('Cannot use values of type "%s" in service configuration files.', get_debug_type($value)));
|
||||
|
||||
Reference in New Issue
Block a user