diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index f175d341e7..339529e519 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -138,11 +138,6 @@ abstract class AnnotationClassLoader implements LoaderInterface } $defaults = array_replace($globals['defaults'], $annot->getDefaults()); - foreach ($method->getParameters() as $param) { - if (!isset($defaults[$param->getName()]) && $param->isDefaultValueAvailable()) { - $defaults[$param->getName()] = $param->getDefaultValue(); - } - } $requirements = array_replace($globals['requirements'], $annot->getRequirements()); $options = array_replace($globals['options'], $annot->getOptions()); $schemes = array_merge($globals['schemes'], $annot->getSchemes()); diff --git a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php index 83bf7108fb..44229633b5 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php @@ -136,11 +136,10 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest array_intersect_assoc($routeData['options'], $route->getOptions()), '->load preserves options annotation' ); - $defaults = array_replace($methodArgs, $routeData['defaults']); $this->assertCount( - count($defaults), - array_intersect_assoc($defaults, $route->getDefaults()), - '->load preserves defaults annotation and merges them with default arguments in method signature' + count($routeData['defaults']), + $route->getDefaults(), + '->load preserves defaults annotation' ); $this->assertEquals($routeData['schemes'], $route->getSchemes(), '->load preserves schemes annotation'); $this->assertEquals($routeData['methods'], $route->getMethods(), '->load preserves methods annotation');