8000 [Routing] fixed Route annotation for hostname (should be hostname_pat… · symfony/symfony@d91e5a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit d91e5a2

Browse files
fabpotarnaud-lb
authored andcommitted
[Routing] fixed Route annotation for hostname (should be hostname_pattern instead of hostnamePattern)
1 parent 62de881 commit d91e5a2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Symfony/Component/Routing/Annotation/Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(array $data)
4444
}
4545

4646
foreach ($data as $key => $value) {
47-
$method = 'set'.$key;
47+
$method = 'set'.str_replace('_', '', $key);
4848
if (!method_exists($this, $method)) {
4949
throw new \BadMethodCallException(sprintf("Unknown property '%s' on annotation '%s'.", $key, get_class($this)));
5050
}

src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public function getValidParameters()
3939
array('requirements', array('_method' => 'GET'), 'getRequirements'),
4040
array('options', array('compiler_class' => 'RouteCompiler'), 'getOptions'),
4141
array('name', 'blog_index', 'getName'),
42-
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults')
42+
array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'),
43+
array('hostname_pattern', array('{locale}.example.com'), 'getHostnamePattern')
4344
);
4445
}
4546
}

0 commit comments

Comments
 (0)
0