Skip to content

Commit 8e102bf

Browse files
Merge branch '4.0'
* 4.0: (28 commits) [DI] Add tests for EnvVarProcessor typo [Bridge\PhpUnit] Fix #26430 Cannot autoload listeners Make sure we always render errors. Eventhough labels are disabled Make sure form errors is valid HTML [HttpKernel] Allow generators in registerBundle [TwigBundle] document TwigRenderer BC break in UPGRADE-3.4 Extra line to bootstrap 3 horizontal layout [Serializer] Remove const override Update Client.php [PhpUnitBridge] Ability to use different composer.json file [DomCrawler] FormField: remove an useless return statement [Config] ReflectionClassResource check abstract ServiceSubscriberInterface and EventSubscriberInterface Display the Welcome Page when there is no homepage defined [DI] Remove dead dumper check Make KernelInterface docblock more fit for bundle-less environment fix regression when extending the Container class without a constructor fix the updating of timestamp in the MemcachedSessionHandler [SecurityBundle] Make extra character non mandatory in regex [Config] Add characters to the regex ...
2 parents 65106de + 1bfe572 commit 8e102bf

15 files changed

+46
-6
lines changed

Matcher/Dumper/PhpMatcherDumper.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,10 @@ private function compileRoutes(RouteCollection $routes, bool $matchHost): string
193193
}
194194
}
195195

196-
if ('' === $code) {
197-
$code .= " if ('/' === \$pathinfo) {\n";
198-
$code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
199-
$code .= " }\n";
200-
}
196+
// used to display the Welcome Page in apps that don't define a homepage
197+
$code .= " if ('/' === \$pathinfo) {\n";
198+
$code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
199+
$code .= " }\n";
201200

202201
return $code;
203202
}

Matcher/UrlMatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function match($pathinfo)
8888
return $ret;
8989
}
9090

91-
if (0 === count($this->routes) && '/' === $pathinfo) {
91+
if ('/' === $pathinfo) {
9292
throw new NoConfigurationException();
9393
}
9494

Tests/Fixtures/dumper/url_matcher1.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ public function match($rawPathinfo)
238238
$offset += strlen($m);
239239
}
240240
}
241+
if ('/' === $pathinfo) {
242+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
243+
}
241244

242245
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
243246
}

Tests/Fixtures/dumper/url_matcher10.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2821,6 +2821,9 @@ public function match($rawPathinfo)
28212821
$offset += strlen($m);
28222822
}
28232823
}
2824+
if ('/' === $pathinfo) {
2825+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
2826+
}
28242827

28252828
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
28262829
}

Tests/Fixtures/dumper/url_matcher11.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a
146146
$offset += strlen($m);
147147
}
148148
}
149+
if ('/' === $pathinfo) {
150+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
151+
}
149152

150153
return null;
151154
}

Tests/Fixtures/dumper/url_matcher12.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public function match($rawPathinfo)
9191
$offset += strlen($m);
9292
}
9393
}
94+
if ('/' === $pathinfo) {
95+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
96+
}
9497

9598
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
9699
}

Tests/Fixtures/dumper/url_matcher13.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public function match($rawPathinfo)
6060
$offset += strlen($m);
6161
}
6262
}
63+
if ('/' === $pathinfo) {
64+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
65+
}
6366

6467
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
6568
}

Tests/Fixtures/dumper/url_matcher2.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$a
275275
$offset += strlen($m);
276276
}
277277
}
278+
if ('/' === $pathinfo) {
279+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
280+
}
278281

279282
return null;
280283
}

Tests/Fixtures/dumper/url_matcher3.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public function match($rawPathinfo)
103103
$offset += strlen($m);
104104
}
105105
}
106+
if ('/' === $pathinfo) {
107+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
108+
}
106109

107110
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
108111
}

Tests/Fixtures/dumper/url_matcher4.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public function match($rawPathinfo)
7575
return $ret;
7676
}
7777

78+
if ('/' === $pathinfo) {
79+
throw new Symfony\Component\Routing\Exception\NoConfigurationException();
80+
}
81+
7882
throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
7983
}
8084
}

0 commit comments

Comments
 (0)