fixed CS in generated files

This commit is contained in:
Fabien Potencier 2019-01-16 13:47:19 +01:00
parent afaa13e946
commit ec7dcb2784
17 changed files with 246 additions and 246 deletions

View File

@ -178,10 +178,10 @@ class DoctrineExtensionTest extends TestCase
['doctrine.orm.cache.apcu.class', ['type' => 'apcu']], ['doctrine.orm.cache.apcu.class', ['type' => 'apcu']],
['doctrine.orm.cache.array.class', ['type' => 'array']], ['doctrine.orm.cache.array.class', ['type' => 'array']],
['doctrine.orm.cache.xcache.class', ['type' => 'xcache']], ['doctrine.orm.cache.xcache.class', ['type' => 'xcache']],
['doctrine.orm.cache.wincache.class', ['type' => 'wincache']], ['doctrine.orm.cache.wincache.class', array ('type' => 'wincache')],
['doctrine.orm.cache.zenddata.class', ['type' => 'zenddata']], ['doctrine.orm.cache.zenddata.class', array ('type' => 'zenddata')],
['doctrine.orm.cache.redis.class', ['type' => 'redis'], ['setRedis']], ['doctrine.orm.cache.redis.class', ['type' => 'redis'], ['setRedis']],
['doctrine.orm.cache.memcache.class', ['type' => 'memcache'], ['setMemcache']], ['doctrine.orm.cache.memcache.class', array ('type' => 'memcache'), array ('setMemcache')],
['doctrine.orm.cache.memcached.class', ['type' => 'memcached'], ['setMemcached']], ['doctrine.orm.cache.memcached.class', ['type' => 'memcached'], ['setMemcached']],
]; ];
} }

View File

@ -35,7 +35,7 @@ class PHPUnit_Util_Test
{ {
public static function getGroups() public static function getGroups()
{ {
return array(); return [];
} }
} }

View File

@ -35,7 +35,7 @@ class PHPUnit_Util_Test
{ {
public static function getGroups() public static function getGroups()
{ {
return array(); return [];
} }
} }

View File

@ -68,15 +68,15 @@ class PathFilterIteratorTest extends IteratorTestCase
[$inner, ['/^A/'], [], ['abc.dat', 'ab.dat', 'a.dat']], [$inner, ['/^A/'], [], ['abc.dat', 'ab.dat', 'a.dat']],
[$inner, ['/^A\/B/'], [], ['abc.dat', 'ab.dat']], [$inner, ['/^A\/B/'], [], ['abc.dat', 'ab.dat']],
[$inner, ['/^A\/B\/C/'], [], ['abc.dat']], [$inner, ['/^A\/B\/C/'], [], ['abc.dat']],
[$inner, ['/A\/B\/C/'], [], ['abc.dat', 'abc.dat.copy']], [$inner, ['/A\/B\/C/'], array (), ['abc.dat', 'abc.dat.copy']],
[$inner, ['A'], [], ['abc.dat', 'ab.dat', 'a.dat', 'abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']], [$inner, ['A'], [], ['abc.dat', 'ab.dat', 'a.dat', 'abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']],
[$inner, ['A/B'], [], ['abc.dat', 'ab.dat', 'abc.dat.copy', 'ab.dat.copy']], [$inner, ['A/B'], [], ['abc.dat', 'ab.dat', 'abc.dat.copy', 'ab.dat.copy']],
[$inner, ['A/B/C'], [], ['abc.dat', 'abc.dat.copy']], [$inner, ['A/B/C'], array (), ['abc.dat', 'abc.dat.copy']],
[$inner, ['copy/A'], [], ['abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']], [$inner, ['copy/A'], [], ['abc.dat.copy', 'ab.dat.copy', 'a.dat.copy']],
[$inner, ['copy/A/B'], [], ['abc.dat.copy', 'ab.dat.copy']], [$inner, ['copy/A/B'], [], ['abc.dat.copy', 'ab.dat.copy']],
[$inner, ['copy/A/B/C'], [], ['abc.dat.copy']], [$inner, ['copy/A/B/C'], array (), ['abc.dat.copy']],
]; ];
} }
} }

View File

@ -95,9 +95,9 @@ class AcceptHeaderTest extends TestCase
public function provideSortingData() public function provideSortingData()
{ {
return [ return [
'quality has priority' => ['*;q=0.3,ISO-8859-1,utf-8;q=0.7', ['ISO-8859-1', 'utf-8', '*']], 'quality has priority' => ['*;q=0.3,ISO-8859-1,utf-8;q=0.7', array ('ISO-8859-1', 'utf-8', '*')],
'order matters when q is equal' => ['*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', ['ISO-8859-1', 'utf-8', '*']], 'order matters when q is equal' => ['*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', array ('ISO-8859-1', 'utf-8', '*')],
'order matters when q is equal2' => ['*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', ['utf-8', 'ISO-8859-1', '*']], 'order matters when q is equal2' => ['*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', array ('utf-8', 'ISO-8859-1', '*')],
]; ];
} }
} }

View File

@ -1025,7 +1025,7 @@ class RequestTest extends TestCase
// forwarded for with remote IPv6 addr not trusted // forwarded for with remote IPv6 addr not trusted
[['1620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null], [['1620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null],
// forwarded for with remote IPv6 addr trusted // forwarded for with remote IPv6 addr trusted
[['2620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', ['1620:0:1cfe:face:b00c::3']], [['2620:0:1cfe:face:b00c::3'], '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', array ('1620:0:1cfe:face:b00c::3')],
// forwarded for with remote IPv6 range trusted // forwarded for with remote IPv6 range trusted
[['88.88.88.88'], '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', ['2a01:198:603:0::/65']], [['88.88.88.88'], '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', ['2a01:198:603:0::/65']],

View File

@ -98,7 +98,7 @@ EOF;
return <<<EOF return <<<EOF
public function match(\$rawPathinfo) public function match(\$rawPathinfo)
{ {
\$allow = array(); \$allow = [];
\$pathinfo = rawurldecode(\$rawPathinfo); \$pathinfo = rawurldecode(\$rawPathinfo);
\$trimmedPathinfo = rtrim(\$pathinfo, '/'); \$trimmedPathinfo = rtrim(\$pathinfo, '/');
\$context = \$this->context; \$context = \$this->context;
@ -290,7 +290,7 @@ EOF;
if ($matches) { if ($matches) {
$vars[] = '$matches'; $vars[] = '$matches';
} }
$vars[] = "array('_route' => '$name')"; $vars[] = "['_route' => '$name']";
$code .= sprintf( $code .= sprintf(
" \$ret = \$this->mergeDefaults(array_replace(%s), %s);\n", " \$ret = \$this->mergeDefaults(array_replace(%s), %s);\n",
@ -300,7 +300,7 @@ EOF;
} elseif ($route->getDefaults()) { } elseif ($route->getDefaults()) {
$code .= sprintf(" \$ret = %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), ['_route' => $name]), true))); $code .= sprintf(" \$ret = %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), ['_route' => $name]), true)));
} else { } else {
$code .= sprintf(" \$ret = array('_route' => '%s');\n", $name); $code .= sprintf(" \$ret = ['_route' => '%s'];\n", $name);
} }
if ($hasTrailingSlash) { if ($hasTrailingSlash) {
@ -331,9 +331,9 @@ EOF;
$code .= <<<EOF $code .= <<<EOF
\$requiredSchemes = $schemes; \$requiredSchemes = $schemes;
\$hasRequiredScheme = isset(\$requiredSchemes[\$context->getScheme()]); \$hasRequiredScheme = isset(\$requiredSchemes[\$context->getScheme()]);
if (!in_array($methodVariable, array('$methods'))) { if (!in_array($methodVariable, ['$methods'])) {
if (\$hasRequiredScheme) { if (\$hasRequiredScheme) {
\$allow = array_merge(\$allow, array('$methods')); \$allow = array_merge(\$allow, ['$methods']);
} }
goto $gotoname; goto $gotoname;
} }
@ -363,8 +363,8 @@ EOF;
} }
} elseif ($methods) { } elseif ($methods) {
$code .= <<<EOF $code .= <<<EOF
if (!in_array($methodVariable, array('$methods'))) { if (!in_array($methodVariable, ['$methods'])) {
\$allow = array_merge(\$allow, array('$methods')); \$allow = array_merge(\$allow, ['$methods']);
goto $gotoname; goto $gotoname;
} }

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/foo')) { if (0 === strpos($pathinfo, '/foo')) {
// foo // foo
if (preg_match('#^/foo/(?P<bar>baz|symfony)$#sD', $pathinfo, $matches)) { if (preg_match('#^/foo/(?P<bar>baz|symfony)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo']), array ( 'def' => 'test',));
} }
// foofoo // foofoo
@ -44,9 +44,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
elseif (0 === strpos($pathinfo, '/bar')) { elseif (0 === strpos($pathinfo, '/bar')) {
// bar // bar
if (preg_match('#^/bar/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/bar/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'bar']), array ());
if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { if (!in_array($canonicalMethod, ['GET', 'HEAD'])) {
$allow = array_merge($allow, array('GET', 'HEAD')); $allow = array_merge($allow, ['GET', 'HEAD']);
goto not_bar; goto not_bar;
} }
@ -56,9 +56,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// barhead // barhead
if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'barhead']), array ());
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_barhead; goto not_barhead;
} }
@ -72,31 +72,31 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/test/baz')) { if (0 === strpos($pathinfo, '/test/baz')) {
// baz // baz
if ('/test/baz' === $pathinfo) { if ('/test/baz' === $pathinfo) {
return array('_route' => 'baz'); return ['_route' => 'baz'];
} }
// baz2 // baz2
if ('/test/baz.html' === $pathinfo) { if ('/test/baz.html' === $pathinfo) {
return array('_route' => 'baz2'); return ['_route' => 'baz2'];
} }
// baz3 // baz3
if ('/test/baz3/' === $pathinfo) { if ('/test/baz3/' === $pathinfo) {
return array('_route' => 'baz3'); return ['_route' => 'baz3'];
} }
} }
// baz4 // baz4
if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'baz4']), array ());
} }
// baz5 // baz5
if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz5']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_baz5; goto not_baz5;
} }
@ -106,9 +106,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// baz.baz6 // baz.baz6
if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz.baz6']), array ());
if (!in_array($requestMethod, array('PUT'))) { if (!in_array($requestMethod, ['PUT'])) {
$allow = array_merge($allow, array('PUT')); $allow = array_merge($allow, ['PUT']);
goto not_bazbaz6; goto not_bazbaz6;
} }
@ -120,42 +120,42 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// quoter // quoter
if (preg_match('#^/(?P<quoter>[\']+)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<quoter>[\']+)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'quoter']), array ());
} }
// space // space
if ('/spa ce' === $pathinfo) { if ('/spa ce' === $pathinfo) {
return array('_route' => 'space'); return ['_route' => 'space'];
} }
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
if (0 === strpos($pathinfo, '/a/b\'b')) { if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo1 // foo1
if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo1']), array ());
} }
// bar1 // bar1
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar1']), array ());
} }
} }
// overridden // overridden
if (preg_match('#^/a/(?P<var>.*)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/(?P<var>.*)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'overridden']), array ());
} }
if (0 === strpos($pathinfo, '/a/b\'b')) { if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo2 // foo2
if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo2']), array ());
} }
// bar2 // bar2
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar2']), array ());
} }
} }
@ -165,40 +165,40 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
elseif (0 === strpos($pathinfo, '/multi')) { elseif (0 === strpos($pathinfo, '/multi')) {
// helloWorld // helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'helloWorld']), array ( 'who' => 'World!',));
} }
// hey // hey
if ('/multi/hey/' === $pathinfo) { if ('/multi/hey/' === $pathinfo) {
return array('_route' => 'hey'); return ['_route' => 'hey'];
} }
// overridden2 // overridden2
if ('/multi/new' === $pathinfo) { if ('/multi/new' === $pathinfo) {
return array('_route' => 'overridden2'); return ['_route' => 'overridden2'];
} }
} }
// foo3 // foo3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo3']), array ());
} }
// bar3 // bar3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar3']), array ());
} }
if (0 === strpos($pathinfo, '/aba')) { if (0 === strpos($pathinfo, '/aba')) {
// ababa // ababa
if ('/ababa' === $pathinfo) { if ('/ababa' === $pathinfo) {
return array('_route' => 'ababa'); return ['_route' => 'ababa'];
} }
// foo4 // foo4
if (preg_match('#^/aba/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/aba/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo4']), array ());
} }
} }
@ -208,12 +208,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
// route1 // route1
if ('/route1' === $pathinfo) { if ('/route1' === $pathinfo) {
return array('_route' => 'route1'); return ['_route' => 'route1'];
} }
// route2 // route2
if ('/c2/route2' === $pathinfo) { if ('/c2/route2' === $pathinfo) {
return array('_route' => 'route2'); return ['_route' => 'route2'];
} }
} }
@ -221,7 +221,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^b\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^b\\.example\\.com$#sDi', $host, $hostMatches)) {
// route3 // route3
if ('/c2/route3' === $pathinfo) { if ('/c2/route3' === $pathinfo) {
return array('_route' => 'route3'); return ['_route' => 'route3'];
} }
} }
@ -229,7 +229,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
// route4 // route4
if ('/route4' === $pathinfo) { if ('/route4' === $pathinfo) {
return array('_route' => 'route4'); return ['_route' => 'route4'];
} }
} }
@ -237,36 +237,36 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
// route5 // route5
if ('/route5' === $pathinfo) { if ('/route5' === $pathinfo) {
return array('_route' => 'route5'); return ['_route' => 'route5'];
} }
} }
// route6 // route6
if ('/route6' === $pathinfo) { if ('/route6' === $pathinfo) {
return array('_route' => 'route6'); return ['_route' => 'route6'];
} }
if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) {
if (0 === strpos($pathinfo, '/route1')) { if (0 === strpos($pathinfo, '/route1')) {
// route11 // route11
if ('/route11' === $pathinfo) { if ('/route11' === $pathinfo) {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route11']), array ());
} }
// route12 // route12
if ('/route12' === $pathinfo) { if ('/route12' === $pathinfo) {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route12']), array ( 'var1' => 'val',));
} }
// route13 // route13
if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ()); return $this->mergeDefaults(array_replace($hostMatches, $matches, ['_route' => 'route13']), array ());
} }
// route14 // route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($hostMatches, $matches, ['_route' => 'route14']), array ( 'var1' => 'val',));
} }
} }
@ -276,35 +276,35 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
// route15 // route15
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'route15']), array ());
} }
} }
// route16 // route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'route16']), array ( 'var1' => 'val',));
} }
// route17 // route17
if ('/route17' === $pathinfo) { if ('/route17' === $pathinfo) {
return array('_route' => 'route17'); return ['_route' => 'route17'];
} }
// a // a
if ('/a/a...' === $pathinfo) { if ('/a/a...' === $pathinfo) {
return array('_route' => 'a'); return ['_route' => 'a'];
} }
if (0 === strpos($pathinfo, '/a/b')) { if (0 === strpos($pathinfo, '/a/b')) {
// b // b
if (preg_match('#^/a/b/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'b']), array ());
} }
// c // c
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'c']), array ());
} }
} }

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/foo')) { if (0 === strpos($pathinfo, '/foo')) {
// foo // foo
if (preg_match('#^/foo/(?P<bar>baz|symfony)$#sD', $pathinfo, $matches)) { if (preg_match('#^/foo/(?P<bar>baz|symfony)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo']), array ( 'def' => 'test',));
} }
// foofoo // foofoo
@ -44,9 +44,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/bar')) { elseif (0 === strpos($pathinfo, '/bar')) {
// bar // bar
if (preg_match('#^/bar/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/bar/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'bar']), array ());
if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { if (!in_array($canonicalMethod, ['GET', 'HEAD'])) {
$allow = array_merge($allow, array('GET', 'HEAD')); $allow = array_merge($allow, ['GET', 'HEAD']);
goto not_bar; goto not_bar;
} }
@ -56,9 +56,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// barhead // barhead
if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'barhead']), array ());
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_barhead; goto not_barhead;
} }
@ -72,17 +72,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/test/baz')) { if (0 === strpos($pathinfo, '/test/baz')) {
// baz // baz
if ('/test/baz' === $pathinfo) { if ('/test/baz' === $pathinfo) {
return array('_route' => 'baz'); return ['_route' => 'baz'];
} }
// baz2 // baz2
if ('/test/baz.html' === $pathinfo) { if ('/test/baz.html' === $pathinfo) {
return array('_route' => 'baz2'); return ['_route' => 'baz2'];
} }
// baz3 // baz3
if ('/test/baz3' === $trimmedPathinfo) { if ('/test/baz3' === $trimmedPathinfo) {
$ret = array('_route' => 'baz3'); $ret = ['_route' => 'baz3'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -99,7 +99,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// baz4 // baz4
if (preg_match('#^/test/(?P<foo>[^/]++)/?$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/?$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz4']), array ());
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -114,9 +114,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// baz5 // baz5
if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz5']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_baz5; goto not_baz5;
} }
@ -126,9 +126,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// baz.baz6 // baz.baz6
if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) { if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz.baz6']), array ());
if (!in_array($requestMethod, array('PUT'))) { if (!in_array($requestMethod, ['PUT'])) {
$allow = array_merge($allow, array('PUT')); $allow = array_merge($allow, ['PUT']);
goto not_bazbaz6; goto not_bazbaz6;
} }
@ -140,42 +140,42 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// quoter // quoter
if (preg_match('#^/(?P<quoter>[\']+)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<quoter>[\']+)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'quoter']), array ());
} }
// space // space
if ('/spa ce' === $pathinfo) { if ('/spa ce' === $pathinfo) {
return array('_route' => 'space'); return ['_route' => 'space'];
} }
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
if (0 === strpos($pathinfo, '/a/b\'b')) { if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo1 // foo1
if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo1']), array ());
} }
// bar1 // bar1
if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar1']), array ());
} }
} }
// overridden // overridden
if (preg_match('#^/a/(?P<var>.*)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/(?P<var>.*)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'overridden']), array ());
} }
if (0 === strpos($pathinfo, '/a/b\'b')) { if (0 === strpos($pathinfo, '/a/b\'b')) {
// foo2 // foo2
if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo2']), array ());
} }
// bar2 // bar2
if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar2']), array ());
} }
} }
@ -185,12 +185,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/multi')) { elseif (0 === strpos($pathinfo, '/multi')) {
// helloWorld // helloWorld
if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'helloWorld']), array ( 'who' => 'World!',));
} }
// hey // hey
if ('/multi/hey' === $trimmedPathinfo) { if ('/multi/hey' === $trimmedPathinfo) {
$ret = array('_route' => 'hey'); $ret = ['_route' => 'hey'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -205,30 +205,30 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// overridden2 // overridden2
if ('/multi/new' === $pathinfo) { if ('/multi/new' === $pathinfo) {
return array('_route' => 'overridden2'); return ['_route' => 'overridden2'];
} }
} }
// foo3 // foo3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo3']), array ());
} }
// bar3 // bar3
if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar3']), array ());
} }
if (0 === strpos($pathinfo, '/aba')) { if (0 === strpos($pathinfo, '/aba')) {
// ababa // ababa
if ('/ababa' === $pathinfo) { if ('/ababa' === $pathinfo) {
return array('_route' => 'ababa'); return ['_route' => 'ababa'];
} }
// foo4 // foo4
if (preg_match('#^/aba/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/aba/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo4']), array ());
} }
} }
@ -238,12 +238,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
// route1 // route1
if ('/route1' === $pathinfo) { if ('/route1' === $pathinfo) {
return array('_route' => 'route1'); return ['_route' => 'route1'];
} }
// route2 // route2
if ('/c2/route2' === $pathinfo) { if ('/c2/route2' === $pathinfo) {
return array('_route' => 'route2'); return ['_route' => 'route2'];
} }
} }
@ -251,7 +251,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^b\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^b\\.example\\.com$#sDi', $host, $hostMatches)) {
// route3 // route3
if ('/c2/route3' === $pathinfo) { if ('/c2/route3' === $pathinfo) {
return array('_route' => 'route3'); return ['_route' => 'route3'];
} }
} }
@ -259,7 +259,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
// route4 // route4
if ('/route4' === $pathinfo) { if ('/route4' === $pathinfo) {
return array('_route' => 'route4'); return ['_route' => 'route4'];
} }
} }
@ -267,36 +267,36 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
// route5 // route5
if ('/route5' === $pathinfo) { if ('/route5' === $pathinfo) {
return array('_route' => 'route5'); return ['_route' => 'route5'];
} }
} }
// route6 // route6
if ('/route6' === $pathinfo) { if ('/route6' === $pathinfo) {
return array('_route' => 'route6'); return ['_route' => 'route6'];
} }
if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) {
if (0 === strpos($pathinfo, '/route1')) { if (0 === strpos($pathinfo, '/route1')) {
// route11 // route11
if ('/route11' === $pathinfo) { if ('/route11' === $pathinfo) {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route11']), array ());
} }
// route12 // route12
if ('/route12' === $pathinfo) { if ('/route12' === $pathinfo) {
return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route12']), array ( 'var1' => 'val',));
} }
// route13 // route13
if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ()); return $this->mergeDefaults(array_replace($hostMatches, $matches, ['_route' => 'route13']), array ());
} }
// route14 // route14
if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($hostMatches, $matches, ['_route' => 'route14']), array ( 'var1' => 'val',));
} }
} }
@ -306,42 +306,42 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
// route15 // route15
if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'route15']), array ());
} }
} }
// route16 // route16
if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',)); return $this->mergeDefaults(array_replace($matches, ['_route' => 'route16']), array ( 'var1' => 'val',));
} }
// route17 // route17
if ('/route17' === $pathinfo) { if ('/route17' === $pathinfo) {
return array('_route' => 'route17'); return ['_route' => 'route17'];
} }
// a // a
if ('/a/a...' === $pathinfo) { if ('/a/a...' === $pathinfo) {
return array('_route' => 'a'); return ['_route' => 'a'];
} }
if (0 === strpos($pathinfo, '/a/b')) { if (0 === strpos($pathinfo, '/a/b')) {
// b // b
if (preg_match('#^/a/b/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/a/b/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'b']), array ());
} }
// c // c
if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'c']), array ());
} }
} }
// secure // secure
if ('/secure' === $pathinfo) { if ('/secure' === $pathinfo) {
$ret = array('_route' => 'secure'); $ret = ['_route' => 'secure'];
$requiredSchemes = array ( 'https' => 0,); $requiredSchemes = array ( 'https' => 0,);
if (!isset($requiredSchemes[$context->getScheme()])) { if (!isset($requiredSchemes[$context->getScheme()])) {
if ('GET' !== $canonicalMethod) { if ('GET' !== $canonicalMethod) {
@ -357,7 +357,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nonsecure // nonsecure
if ('/nonsecure' === $pathinfo) { if ('/nonsecure' === $pathinfo) {
$ret = array('_route' => 'nonsecure'); $ret = ['_route' => 'nonsecure'];
$requiredSchemes = array ( 'http' => 0,); $requiredSchemes = array ( 'http' => 0,);
if (!isset($requiredSchemes[$context->getScheme()])) { if (!isset($requiredSchemes[$context->getScheme()])) {
if ('GET' !== $canonicalMethod) { if ('GET' !== $canonicalMethod) {

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,19 +31,19 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/rootprefix')) { if (0 === strpos($pathinfo, '/rootprefix')) {
// static // static
if ('/rootprefix/test' === $pathinfo) { if ('/rootprefix/test' === $pathinfo) {
return array('_route' => 'static'); return ['_route' => 'static'];
} }
// dynamic // dynamic
if (preg_match('#^/rootprefix/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/rootprefix/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'dynamic']), array ());
} }
} }
// with-condition // with-condition
if ('/with-condition' === $pathinfo && ($context->getMethod() == "GET")) { if ('/with-condition' === $pathinfo && ($context->getMethod() == "GET")) {
return array('_route' => 'with-condition'); return ['_route' => 'with-condition'];
} }
if ('/' === $pathinfo && !$allow) { if ('/' === $pathinfo && !$allow) {

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -30,9 +30,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// just_head // just_head
if ('/just_head' === $pathinfo) { if ('/just_head' === $pathinfo) {
$ret = array('_route' => 'just_head'); $ret = ['_route' => 'just_head'];
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_just_head; goto not_just_head;
} }
@ -42,9 +42,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// head_and_get // head_and_get
if ('/head_and_get' === $pathinfo) { if ('/head_and_get' === $pathinfo) {
$ret = array('_route' => 'head_and_get'); $ret = ['_route' => 'head_and_get'];
if (!in_array($canonicalMethod, array('HEAD', 'GET'))) { if (!in_array($canonicalMethod, ['HEAD', 'GET'])) {
$allow = array_merge($allow, array('HEAD', 'GET')); $allow = array_merge($allow, ['HEAD', 'GET']);
goto not_head_and_get; goto not_head_and_get;
} }
@ -54,9 +54,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// get_and_head // get_and_head
if ('/get_and_head' === $pathinfo) { if ('/get_and_head' === $pathinfo) {
$ret = array('_route' => 'get_and_head'); $ret = ['_route' => 'get_and_head'];
if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { if (!in_array($canonicalMethod, ['GET', 'HEAD'])) {
$allow = array_merge($allow, array('GET', 'HEAD')); $allow = array_merge($allow, ['GET', 'HEAD']);
goto not_get_and_head; goto not_get_and_head;
} }
@ -66,9 +66,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// post_and_head // post_and_head
if ('/post_and_head' === $pathinfo) { if ('/post_and_head' === $pathinfo) {
$ret = array('_route' => 'post_and_head'); $ret = ['_route' => 'post_and_head'];
if (!in_array($requestMethod, array('POST', 'HEAD'))) { if (!in_array($requestMethod, ['POST', 'HEAD'])) {
$allow = array_merge($allow, array('POST', 'HEAD')); $allow = array_merge($allow, ['POST', 'HEAD']);
goto not_post_and_head; goto not_post_and_head;
} }
@ -79,9 +79,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/put_and_post')) { if (0 === strpos($pathinfo, '/put_and_post')) {
// put_and_post // put_and_post
if ('/put_and_post' === $pathinfo) { if ('/put_and_post' === $pathinfo) {
$ret = array('_route' => 'put_and_post'); $ret = ['_route' => 'put_and_post'];
if (!in_array($requestMethod, array('PUT', 'POST'))) { if (!in_array($requestMethod, ['PUT', 'POST'])) {
$allow = array_merge($allow, array('PUT', 'POST')); $allow = array_merge($allow, ['PUT', 'POST']);
goto not_put_and_post; goto not_put_and_post;
} }
@ -91,9 +91,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// put_and_get_and_head // put_and_get_and_head
if ('/put_and_post' === $pathinfo) { if ('/put_and_post' === $pathinfo) {
$ret = array('_route' => 'put_and_get_and_head'); $ret = ['_route' => 'put_and_get_and_head'];
if (!in_array($canonicalMethod, array('PUT', 'GET', 'HEAD'))) { if (!in_array($canonicalMethod, ['PUT', 'GET', 'HEAD'])) {
$allow = array_merge($allow, array('PUT', 'GET', 'HEAD')); $allow = array_merge($allow, ['PUT', 'GET', 'HEAD']);
goto not_put_and_get_and_head; goto not_put_and_get_and_head;
} }

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,30 +31,30 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
// a_first // a_first
if ('/a/11' === $pathinfo) { if ('/a/11' === $pathinfo) {
return array('_route' => 'a_first'); return ['_route' => 'a_first'];
} }
// a_second // a_second
if ('/a/22' === $pathinfo) { if ('/a/22' === $pathinfo) {
return array('_route' => 'a_second'); return ['_route' => 'a_second'];
} }
// a_third // a_third
if ('/a/333' === $pathinfo) { if ('/a/333' === $pathinfo) {
return array('_route' => 'a_third'); return ['_route' => 'a_third'];
} }
} }
// a_wildcard // a_wildcard
if (preg_match('#^/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (preg_match('#^/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'a_wildcard')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'a_wildcard']), array ());
} }
if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a')) {
// a_fourth // a_fourth
if ('/a/44' === $trimmedPathinfo) { if ('/a/44' === $trimmedPathinfo) {
$ret = array('_route' => 'a_fourth'); $ret = ['_route' => 'a_fourth'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -69,7 +69,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// a_fifth // a_fifth
if ('/a/55' === $trimmedPathinfo) { if ('/a/55' === $trimmedPathinfo) {
$ret = array('_route' => 'a_fifth'); $ret = ['_route' => 'a_fifth'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -84,7 +84,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// a_sixth // a_sixth
if ('/a/66' === $trimmedPathinfo) { if ('/a/66' === $trimmedPathinfo) {
$ret = array('_route' => 'a_sixth'); $ret = ['_route' => 'a_sixth'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -101,13 +101,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nested_wildcard // nested_wildcard
if (0 === strpos($pathinfo, '/nested') && preg_match('#^/nested/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/nested') && preg_match('#^/nested/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'nested_wildcard')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'nested_wildcard']), array ());
} }
if (0 === strpos($pathinfo, '/nested/group')) { if (0 === strpos($pathinfo, '/nested/group')) {
// nested_a // nested_a
if ('/nested/group/a' === $trimmedPathinfo) { if ('/nested/group/a' === $trimmedPathinfo) {
$ret = array('_route' => 'nested_a'); $ret = ['_route' => 'nested_a'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -122,7 +122,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nested_b // nested_b
if ('/nested/group/b' === $trimmedPathinfo) { if ('/nested/group/b' === $trimmedPathinfo) {
$ret = array('_route' => 'nested_b'); $ret = ['_route' => 'nested_b'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -137,7 +137,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// nested_c // nested_c
if ('/nested/group/c' === $trimmedPathinfo) { if ('/nested/group/c' === $trimmedPathinfo) {
$ret = array('_route' => 'nested_c'); $ret = ['_route' => 'nested_c'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -155,7 +155,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/slashed/group')) { elseif (0 === strpos($pathinfo, '/slashed/group')) {
// slashed_a // slashed_a
if ('/slashed/group' === $trimmedPathinfo) { if ('/slashed/group' === $trimmedPathinfo) {
$ret = array('_route' => 'slashed_a'); $ret = ['_route' => 'slashed_a'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -170,7 +170,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// slashed_b // slashed_b
if ('/slashed/group/b' === $trimmedPathinfo) { if ('/slashed/group/b' === $trimmedPathinfo) {
$ret = array('_route' => 'slashed_b'); $ret = ['_route' => 'slashed_b'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -185,7 +185,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// slashed_c // slashed_c
if ('/slashed/group/c' === $trimmedPathinfo) { if ('/slashed/group/c' === $trimmedPathinfo) {
$ret = array('_route' => 'slashed_c'); $ret = ['_route' => 'slashed_c'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,14 +31,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
if (0 === strpos($pathinfo, '/trailing/simple')) { if (0 === strpos($pathinfo, '/trailing/simple')) {
// simple_trailing_slash_no_methods // simple_trailing_slash_no_methods
if ('/trailing/simple/no-methods/' === $pathinfo) { if ('/trailing/simple/no-methods/' === $pathinfo) {
return array('_route' => 'simple_trailing_slash_no_methods'); return ['_route' => 'simple_trailing_slash_no_methods'];
} }
// simple_trailing_slash_GET_method // simple_trailing_slash_GET_method
if ('/trailing/simple/get-method/' === $pathinfo) { if ('/trailing/simple/get-method/' === $pathinfo) {
$ret = array('_route' => 'simple_trailing_slash_GET_method'); $ret = ['_route' => 'simple_trailing_slash_GET_method'];
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_simple_trailing_slash_GET_method; goto not_simple_trailing_slash_GET_method;
} }
@ -48,9 +48,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// simple_trailing_slash_HEAD_method // simple_trailing_slash_HEAD_method
if ('/trailing/simple/head-method/' === $pathinfo) { if ('/trailing/simple/head-method/' === $pathinfo) {
$ret = array('_route' => 'simple_trailing_slash_HEAD_method'); $ret = ['_route' => 'simple_trailing_slash_HEAD_method'];
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_simple_trailing_slash_HEAD_method; goto not_simple_trailing_slash_HEAD_method;
} }
@ -60,9 +60,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// simple_trailing_slash_POST_method // simple_trailing_slash_POST_method
if ('/trailing/simple/post-method/' === $pathinfo) { if ('/trailing/simple/post-method/' === $pathinfo) {
$ret = array('_route' => 'simple_trailing_slash_POST_method'); $ret = ['_route' => 'simple_trailing_slash_POST_method'];
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_simple_trailing_slash_POST_method; goto not_simple_trailing_slash_POST_method;
} }
@ -75,14 +75,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
elseif (0 === strpos($pathinfo, '/trailing/regex')) { elseif (0 === strpos($pathinfo, '/trailing/regex')) {
// regex_trailing_slash_no_methods // regex_trailing_slash_no_methods
if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_no_methods']), array ());
} }
// regex_trailing_slash_GET_method // regex_trailing_slash_GET_method
if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_GET_method']), array ());
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_regex_trailing_slash_GET_method; goto not_regex_trailing_slash_GET_method;
} }
@ -92,9 +92,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// regex_trailing_slash_HEAD_method // regex_trailing_slash_HEAD_method
if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_HEAD_method']), array ());
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_regex_trailing_slash_HEAD_method; goto not_regex_trailing_slash_HEAD_method;
} }
@ -104,9 +104,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// regex_trailing_slash_POST_method // regex_trailing_slash_POST_method
if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_POST_method']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_regex_trailing_slash_POST_method; goto not_regex_trailing_slash_POST_method;
} }
@ -119,14 +119,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
elseif (0 === strpos($pathinfo, '/not-trailing/simple')) { elseif (0 === strpos($pathinfo, '/not-trailing/simple')) {
// simple_not_trailing_slash_no_methods // simple_not_trailing_slash_no_methods
if ('/not-trailing/simple/no-methods' === $pathinfo) { if ('/not-trailing/simple/no-methods' === $pathinfo) {
return array('_route' => 'simple_not_trailing_slash_no_methods'); return ['_route' => 'simple_not_trailing_slash_no_methods'];
} }
// simple_not_trailing_slash_GET_method // simple_not_trailing_slash_GET_method
if ('/not-trailing/simple/get-method' === $pathinfo) { if ('/not-trailing/simple/get-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_GET_method'); $ret = ['_route' => 'simple_not_trailing_slash_GET_method'];
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_simple_not_trailing_slash_GET_method; goto not_simple_not_trailing_slash_GET_method;
} }
@ -136,9 +136,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// simple_not_trailing_slash_HEAD_method // simple_not_trailing_slash_HEAD_method
if ('/not-trailing/simple/head-method' === $pathinfo) { if ('/not-trailing/simple/head-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_HEAD_method'); $ret = ['_route' => 'simple_not_trailing_slash_HEAD_method'];
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_simple_not_trailing_slash_HEAD_method; goto not_simple_not_trailing_slash_HEAD_method;
} }
@ -148,9 +148,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// simple_not_trailing_slash_POST_method // simple_not_trailing_slash_POST_method
if ('/not-trailing/simple/post-method' === $pathinfo) { if ('/not-trailing/simple/post-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_POST_method'); $ret = ['_route' => 'simple_not_trailing_slash_POST_method'];
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_simple_not_trailing_slash_POST_method; goto not_simple_not_trailing_slash_POST_method;
} }
@ -163,14 +163,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
elseif (0 === strpos($pathinfo, '/not-trailing/regex')) { elseif (0 === strpos($pathinfo, '/not-trailing/regex')) {
// regex_not_trailing_slash_no_methods // regex_not_trailing_slash_no_methods
if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_no_methods']), array ());
} }
// regex_not_trailing_slash_GET_method // regex_not_trailing_slash_GET_method
if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_GET_method']), array ());
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_regex_not_trailing_slash_GET_method; goto not_regex_not_trailing_slash_GET_method;
} }
@ -180,9 +180,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// regex_not_trailing_slash_HEAD_method // regex_not_trailing_slash_HEAD_method
if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_HEAD_method']), array ());
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_regex_not_trailing_slash_HEAD_method; goto not_regex_not_trailing_slash_HEAD_method;
} }
@ -192,9 +192,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
// regex_not_trailing_slash_POST_method // regex_not_trailing_slash_POST_method
if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_POST_method']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_regex_not_trailing_slash_POST_method; goto not_regex_not_trailing_slash_POST_method;
} }

View File

@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
public function match($rawPathinfo) public function match($rawPathinfo)
{ {
$allow = array(); $allow = [];
$pathinfo = rawurldecode($rawPathinfo); $pathinfo = rawurldecode($rawPathinfo);
$trimmedPathinfo = rtrim($pathinfo, '/'); $trimmedPathinfo = rtrim($pathinfo, '/');
$context = $this->context; $context = $this->context;
@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
if (0 === strpos($pathinfo, '/trailing/simple')) { if (0 === strpos($pathinfo, '/trailing/simple')) {
// simple_trailing_slash_no_methods // simple_trailing_slash_no_methods
if ('/trailing/simple/no-methods' === $trimmedPathinfo) { if ('/trailing/simple/no-methods' === $trimmedPathinfo) {
$ret = array('_route' => 'simple_trailing_slash_no_methods'); $ret = ['_route' => 'simple_trailing_slash_no_methods'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -46,7 +46,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// simple_trailing_slash_GET_method // simple_trailing_slash_GET_method
if ('/trailing/simple/get-method' === $trimmedPathinfo) { if ('/trailing/simple/get-method' === $trimmedPathinfo) {
$ret = array('_route' => 'simple_trailing_slash_GET_method'); $ret = ['_route' => 'simple_trailing_slash_GET_method'];
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -55,8 +55,8 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method')); return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method'));
} }
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_simple_trailing_slash_GET_method; goto not_simple_trailing_slash_GET_method;
} }
@ -66,9 +66,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// simple_trailing_slash_HEAD_method // simple_trailing_slash_HEAD_method
if ('/trailing/simple/head-method/' === $pathinfo) { if ('/trailing/simple/head-method/' === $pathinfo) {
$ret = array('_route' => 'simple_trailing_slash_HEAD_method'); $ret = ['_route' => 'simple_trailing_slash_HEAD_method'];
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_simple_trailing_slash_HEAD_method; goto not_simple_trailing_slash_HEAD_method;
} }
@ -78,9 +78,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// simple_trailing_slash_POST_method // simple_trailing_slash_POST_method
if ('/trailing/simple/post-method/' === $pathinfo) { if ('/trailing/simple/post-method/' === $pathinfo) {
$ret = array('_route' => 'simple_trailing_slash_POST_method'); $ret = ['_route' => 'simple_trailing_slash_POST_method'];
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_simple_trailing_slash_POST_method; goto not_simple_trailing_slash_POST_method;
} }
@ -93,7 +93,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/trailing/regex')) { elseif (0 === strpos($pathinfo, '/trailing/regex')) {
// regex_trailing_slash_no_methods // regex_trailing_slash_no_methods
if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P<param>[^/]++)/?$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P<param>[^/]++)/?$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_no_methods']), array ());
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -108,7 +108,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// regex_trailing_slash_GET_method // regex_trailing_slash_GET_method
if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P<param>[^/]++)/?$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P<param>[^/]++)/?$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_GET_method']), array ());
if ('/' === substr($pathinfo, -1)) { if ('/' === substr($pathinfo, -1)) {
// no-op // no-op
} elseif ('GET' !== $canonicalMethod) { } elseif ('GET' !== $canonicalMethod) {
@ -117,8 +117,8 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method')); return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method'));
} }
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_regex_trailing_slash_GET_method; goto not_regex_trailing_slash_GET_method;
} }
@ -128,9 +128,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// regex_trailing_slash_HEAD_method // regex_trailing_slash_HEAD_method
if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_HEAD_method']), array ());
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_regex_trailing_slash_HEAD_method; goto not_regex_trailing_slash_HEAD_method;
} }
@ -140,9 +140,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// regex_trailing_slash_POST_method // regex_trailing_slash_POST_method
if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P<param>[^/]++)/$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_POST_method']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_regex_trailing_slash_POST_method; goto not_regex_trailing_slash_POST_method;
} }
@ -155,14 +155,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/not-trailing/simple')) { elseif (0 === strpos($pathinfo, '/not-trailing/simple')) {
// simple_not_trailing_slash_no_methods // simple_not_trailing_slash_no_methods
if ('/not-trailing/simple/no-methods' === $pathinfo) { if ('/not-trailing/simple/no-methods' === $pathinfo) {
return array('_route' => 'simple_not_trailing_slash_no_methods'); return ['_route' => 'simple_not_trailing_slash_no_methods'];
} }
// simple_not_trailing_slash_GET_method // simple_not_trailing_slash_GET_method
if ('/not-trailing/simple/get-method' === $pathinfo) { if ('/not-trailing/simple/get-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_GET_method'); $ret = ['_route' => 'simple_not_trailing_slash_GET_method'];
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_simple_not_trailing_slash_GET_method; goto not_simple_not_trailing_slash_GET_method;
} }
@ -172,9 +172,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// simple_not_trailing_slash_HEAD_method // simple_not_trailing_slash_HEAD_method
if ('/not-trailing/simple/head-method' === $pathinfo) { if ('/not-trailing/simple/head-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_HEAD_method'); $ret = ['_route' => 'simple_not_trailing_slash_HEAD_method'];
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_simple_not_trailing_slash_HEAD_method; goto not_simple_not_trailing_slash_HEAD_method;
} }
@ -184,9 +184,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// simple_not_trailing_slash_POST_method // simple_not_trailing_slash_POST_method
if ('/not-trailing/simple/post-method' === $pathinfo) { if ('/not-trailing/simple/post-method' === $pathinfo) {
$ret = array('_route' => 'simple_not_trailing_slash_POST_method'); $ret = ['_route' => 'simple_not_trailing_slash_POST_method'];
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_simple_not_trailing_slash_POST_method; goto not_simple_not_trailing_slash_POST_method;
} }
@ -199,14 +199,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
elseif (0 === strpos($pathinfo, '/not-trailing/regex')) { elseif (0 === strpos($pathinfo, '/not-trailing/regex')) {
// regex_not_trailing_slash_no_methods // regex_not_trailing_slash_no_methods
if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array ()); return $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_no_methods']), array ());
} }
// regex_not_trailing_slash_GET_method // regex_not_trailing_slash_GET_method
if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_GET_method']), array ());
if (!in_array($canonicalMethod, array('GET'))) { if (!in_array($canonicalMethod, ['GET'])) {
$allow = array_merge($allow, array('GET')); $allow = array_merge($allow, ['GET']);
goto not_regex_not_trailing_slash_GET_method; goto not_regex_not_trailing_slash_GET_method;
} }
@ -216,9 +216,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// regex_not_trailing_slash_HEAD_method // regex_not_trailing_slash_HEAD_method
if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_HEAD_method']), array ());
if (!in_array($requestMethod, array('HEAD'))) { if (!in_array($requestMethod, ['HEAD'])) {
$allow = array_merge($allow, array('HEAD')); $allow = array_merge($allow, ['HEAD']);
goto not_regex_not_trailing_slash_HEAD_method; goto not_regex_not_trailing_slash_HEAD_method;
} }
@ -228,9 +228,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
// regex_not_trailing_slash_POST_method // regex_not_trailing_slash_POST_method
if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) { if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P<param>[^/]++)$#sD', $pathinfo, $matches)) {
$ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_POST_method']), array ());
if (!in_array($requestMethod, array('POST'))) { if (!in_array($requestMethod, ['POST'])) {
$allow = array_merge($allow, array('POST')); $allow = array_merge($allow, ['POST']);
goto not_regex_not_trailing_slash_POST_method; goto not_regex_not_trailing_slash_POST_method;
} }

View File

@ -11,11 +11,11 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig\Template
parent::__construct($env); parent::__construct($env);
} }
$this->parent = false; $this->parent = false;
$this->blocks = array(); $this->blocks = [];
$this->path = $path; $this->path = $path;
} }
protected function doDisplay(array $context, array $blocks = array()) protected function doDisplay(array $context, array $blocks = [])
{ {
// line 2 // line 2
throw new \Exception('Foobar'); throw new \Exception('Foobar');
@ -28,7 +28,7 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig\Template
public function getDebugInfo() public function getDebugInfo()
{ {
return array(20 => 1, 21 => 2); return [20 => 1, 21 => 2];
} }
public function getSourceContext() public function getSourceContext()

View File

@ -14,19 +14,19 @@ $foo->bar = 'bar';
$g = fopen(__FILE__, 'r'); $g = fopen(__FILE__, 'r');
$var = array( $var = [
'number' => 1, null, 'number' => 1, null,
'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX, 'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX,
'str' => "déjà\n", "\xE9\x00", 'str' => "déjà\n", "\xE9\x00",
'[]' => array(), '[]' => [],
'res' => $g, 'res' => $g,
'obj' => $foo, 'obj' => $foo,
'closure' => function ($a, \PDO &$b = null) {}, 'closure' => function ($a, \PDO &$b = null) {},
'line' => __LINE__ - 1, 'line' => __LINE__ - 1,
'nobj' => array((object) array()), 'nobj' => [(object) []],
); ];
$r = array(); $r = [];
$r[] = &$r; $r[] = &$r;
$var['recurs'] = &$r; $var['recurs'] = &$r;