diff --git a/src/Bundle/Controller/Parameters.php b/src/Bundle/Controller/Parameters.php index 1eeb3ffe0..66fa0405f 100644 --- a/src/Bundle/Controller/Parameters.php +++ b/src/Bundle/Controller/Parameters.php @@ -16,7 +16,24 @@ use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpKernel\Kernel; -if (Kernel::MAJOR_VERSION === 5) { +if (Kernel::MAJOR_VERSION === 6) { + class Parameters extends ParameterBag + { + /** + * @param mixed $default + */ + public function get(string $key, $default = null): mixed + { + $result = parent::get($key, $default); + + if (null === $result && $default !== null && $this->has($key)) { + $result = $default; + } + + return $result; + } + } +} elseif (Kernel::MAJOR_VERSION === 5) { class Parameters extends ParameterBag { /**