diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index b63dc5c85e665..7dad0136ad611 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -205,7 +205,8 @@ protected function addRoute(RouteCollection $collection, object $annot, array $g } foreach ($paths as $locale => $path) { if (preg_match(sprintf('/\{%s(?:<.*?>)?\}/', preg_quote($param->name)), $path)) { - $defaults[$param->name] = $param->getDefaultValue(); + $defaultValue = $param->getDefaultValue(); + $defaults[$param->name] = $defaultValue instanceof \BackedEnum ? $defaultValue->value : $defaultValue; break; } }