10000 feature #22880 [Routing] remove deprecated features (xabbuh) · symfony/symfony@ad2c9f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit ad2c9f0

Browse files
committed
feature #22880 [Routing] remove deprecated features (xabbuh)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Routing] remove deprecated features | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 9560031 [Routing] remove deprecated features
2 parents 4c7da9f + 9560031 commit ad2c9f0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/Symfony/Component/Routing/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* dropped support for using UTF-8 route patterns without using the `utf8` option
8+
* dropped support for using UTF-8 route requirements without using the `utf8` option
9+
410
3.3.0
511
-----
612

src/Symfony/Component/Routing/RouteCompiler.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ private static function compilePattern(Route $route, $pattern, $isHost)
103103
$needsUtf8 = $route->getOption('utf8');
104104

105105
if (!$needsUtf8 && $useUtf8 && preg_match('/[\x80-\xFF]/', $pattern)) {
106-
$needsUtf8 = true;
107-
@trigger_error(sprintf('Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "%s".', $pattern), E_USER_DEPRECATED);
106+
throw new \LogicException(sprintf('Cannot use UTF-8 route patterns without setting the "utf8" option for route "%s".', $route->getPath()));
108107
}
109108
if (!$useUtf8 && $needsUtf8) {
110109
throw new \LogicException(sprintf('Cannot mix UTF-8 requirements with non-UTF-8 pattern "%s".', $pattern));
@@ -176,8 +175,7 @@ private static function compilePattern(Route $route, $pattern, $isHost)
176175
if (!preg_match('//u', $regexp)) {
177176
$useUtf8 = false;
178177
} elseif (!$needsUtf8 && preg_match('/[\x80-\xFF]|(?<!\\\\)\\\\(?:\\\\\\\\)*+(?-i:X|[pP][\{CLMNPSZ]|x\{[A-Fa-f0-9]{3})/', $regexp)) {
179-
$needsUtf8 = true;
180-
@trigger_error(sprintf('Using UTF-8 route requirements without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for variable "%s" in pattern "%s".', $varName, $pattern), E_USER_DEPRECATED);
178+
throw new \LogicException(sprintf('Cannot use UTF-8 route requirements without setting the "utf8" option for variable "%s" in pattern "%s".', $varName, $pattern));
181179
}
182180
if (!$useUtf8 && $needsUtf8) {
183181
throw new \LogicException(sprintf('Cannot mix UTF-8 requirement with non-UTF-8 charset for variable "%s" in pattern "%s".', $varName, $pattern));

src/Symfony/Component/Routing/Tests/RouteCompilerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ public function provideCompileData()
184184
}
185185

186186
/**
187-
* @group legacy
188187
* @dataProvider provideCompileImplicitUtf8Data
189-
* @expectedDeprecation Using UTF-8 route %s without setting the "utf8" option is deprecated %s.
188+
* @expectedException \LogicException
190189
*/
191190
public function testCompileImplicitUtf8Data($name, $arguments, $prefix, $regex, $variables, $tokens, $deprecationType)
192191
{

0 commit comments

Comments
 (0)
0