File tree 2 files changed +6
-5
lines changed
src/Symfony/Component/Routing 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ class RouteCompiler implements RouteCompilerInterface
31
31
/**
32
32
* {@inheritdoc}
33
33
*
34
- * @throws \LogicException If a variable is referenced more than once
35
- * @throws \DomainException If a variable name is numeric because PHP raises an error for such
36
- * subpatterns in PCRE and thus would break matching, e.g. "(?P<123>.+)".
34
+ * @throws \InvalidArgumentException If a path variable is named _fragment
35
+ * @throws \LogicException If a variable is referenced more than once
36
+ * @throws \DomainException If a variable name is numeric because PHP raises an error for such
37
+ * subpatterns in PCRE and thus would break matching, e.g. "(?P<123>.+)".
37
38
*/
38
39
public static function compile (Route $ route )
39
40
{
@@ -62,7 +63,7 @@ public static function compile(Route $route)
62
63
63
64
foreach ($ pathVariables as $ pathParam ) {
64
65
if ('_fragment ' === $ pathParam ) {
65
- throw new \LogicException (sprintf ('Route pattern "%s" cannot contain "_fragment" as a path parameter. ' , $ route ->getPath ()));
66
+ throw new \InvalidArgumentException (sprintf ('Route pattern "%s" cannot contain "_fragment" as a path parameter. ' , $ route ->getPath ()));
66
67
}
67
68
}
68
69
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ public function testRouteWithSameVariableTwice()
162
162
}
163
163
164
164
/**
165
- * @expectedException \LogicException
165
+ * @expectedException \InvalidArgumentException
166
166
*/
167
167
public function testRouteWithFragmentAsPathParameter ()
168
168
{
You can’t perform that action at this time.
0 commit comments