框架升级及修复升级后的bug

This commit is contained in:
Dev
2026-10-16 18:13:09 +08:00
parent dafb0c96c0
commit 2d342bcbd7
537 changed files with 49836 additions and 40933 deletions
+5 -3
View File
@@ -163,7 +163,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
*/
public function getInt(string $key, int $default = 0): int
{
return $this->filter($key, $default, \FILTER_VALIDATE_INT, ['flags' => \FILTER_REQUIRE_SCALAR | \FILTER_NULL_ON_FAILURE]) ?? throw new UnexpectedValueException(\sprintf('Parameter value "%s" cannot be converted to "int".', $key));
return $this->filter($key, $default, \FILTER_VALIDATE_INT, ['flags' => \FILTER_REQUIRE_SCALAR]);
}
/**
@@ -173,7 +173,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
*/
public function getBoolean(string $key, bool $default = false): bool
{
return $this->filter($key, $default, \FILTER_VALIDATE_BOOL, ['flags' => \FILTER_REQUIRE_SCALAR | \FILTER_NULL_ON_FAILURE]) ?? throw new UnexpectedValueException(\sprintf('Parameter value "%s" cannot be converted to "bool".', $key));
return $this->filter($key, $default, \FILTER_VALIDATE_BOOL, ['flags' => \FILTER_REQUIRE_SCALAR]);
}
/**
@@ -192,7 +192,9 @@ class ParameterBag implements \IteratorAggregate, \Countable
*/
public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum
{
if (null === $value = $this->get($key)) {
$value = $this->get($key);
if (null === $value) {
return $default;
}