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:
jf-cbd
2026-04-20 14:47:44 +02:00
committed by GitHub
parent f439490bfc
commit 805087a01b
171 changed files with 5629 additions and 1446 deletions

View File

@@ -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)));