Skip to content

Commit d7d4a20

Browse files
Merge branch '2.7' into 2.8
* 2.7: Fix backport [travis] Upgrade phpunit wrapper & hirak/prestissimo [Bridge\PhpUnit] Workaround old phpunit bug, no colors in weak mode, add tests [PropertyAccess] Fix isPropertyWritable not using the reflection cache [PropertyAccess] Backport fixes from 2.7 [Validator] use correct term for a property in docblock (not "option") [Routing] small refactoring for scheme requirement [PropertyAccess] Remove most ref mismatches to improve perf [Validator] EmailValidator cannot extract hostname if email contains multiple @ symbols [NumberFormatter] Fix invalid numeric literal on PHP 7 [Process] fix docblock syntax Use XML_ELEMENT_NODE in nodeType check [PropertyAccess] Reduce overhead of UnexpectedTypeException tracking [PropertyAccess] Throw an UnexpectedTypeException when the type do not match [FrameworkBundle] Add tests for the Controller class [FrameworkBundle] Add tests for the Controller class [Process] getIncrementalOutput should work without calling getOutput Conflicts: src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php src/Symfony/Bridge/PhpUnit/TextUI/Command.php src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php
2 parents edfef8e + f3fad0e commit d7d4a20

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

Generator/UrlGenerator.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
216216
$scheme = $this->context->getScheme();
217217

218218
if ($requiredSchemes) {
219-
$schemeMatched = false;
220-
foreach ($requiredSchemes as $requiredScheme) {
221-
if ($scheme === $requiredScheme) {
222-
$schemeMatched = true;
223-
224-
break;
225-
}
226-
}
227-
228-
if (!$schemeMatched) {
219+
if (!in_array($scheme, $requiredSchemes, true)) {
229220
$referenceType = self::ABSOLUTE_URL;
230221
$scheme = current($requiredSchemes);
231222
}

0 commit comments

Comments
 (0)