diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index 8fcb07465a..fa848e8d2c 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -178,10 +178,10 @@ class DoctrineExtensionTest extends TestCase ['doctrine.orm.cache.apcu.class', ['type' => 'apcu']], ['doctrine.orm.cache.array.class', ['type' => 'array']], ['doctrine.orm.cache.xcache.class', ['type' => 'xcache']], - ['doctrine.orm.cache.wincache.class', ['type' => 'wincache']], - ['doctrine.orm.cache.zenddata.class', ['type' => 'zenddata']], + ['doctrine.orm.cache.wincache.class', array ('type' => 'wincache')], + ['doctrine.orm.cache.zenddata.class', array ('type' => 'zenddata')], ['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']], ]; } diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt index 7a0595a7dd..1070b19a43 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/default.phpt @@ -35,7 +35,7 @@ class PHPUnit_Util_Test { public static function getGroups() { - return array(); + return []; } } diff --git a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt index fddeed6085..a0bf3e2ba7 100644 --- a/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt +++ b/src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/shutdown_deprecations.phpt @@ -35,7 +35,7 @@ class PHPUnit_Util_Test { public static function getGroups() { - return array(); + return []; } } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php index d44651771f..1c3c95dc5c 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php @@ -68,15 +68,15 @@ class PathFilterIteratorTest extends IteratorTestCase [$inner, ['/^A/'], [], ['abc.dat', 'ab.dat', 'a.dat']], [$inner, ['/^A\/B/'], [], ['abc.dat', 'ab.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/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/B'], [], ['abc.dat.copy', 'ab.dat.copy']], - [$inner, ['copy/A/B/C'], [], ['abc.dat.copy']], + [$inner, ['copy/A/B/C'], array (), ['abc.dat.copy']], ]; } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderTest.php b/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderTest.php index 459b693d5c..d5518cc3cd 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderTest.php @@ -95,9 +95,9 @@ class AcceptHeaderTest extends TestCase public function provideSortingData() { return [ - 'quality has priority' => ['*;q=0.3,ISO-8859-1,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', ['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', '*']], + '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', 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', array ('utf-8', 'ISO-8859-1', '*')], ]; } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 505f271eab..9e60e47054 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -1025,7 +1025,7 @@ class RequestTest extends TestCase // 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], // 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 [['88.88.88.88'], '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', ['2a01:198:603:0::/65']], diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index 7c1ec2a6f6..0a830b64d5 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -98,7 +98,7 @@ EOF; return <<context; @@ -290,7 +290,7 @@ EOF; if ($matches) { $vars[] = '$matches'; } - $vars[] = "array('_route' => '$name')"; + $vars[] = "['_route' => '$name']"; $code .= sprintf( " \$ret = \$this->mergeDefaults(array_replace(%s), %s);\n", @@ -300,7 +300,7 @@ EOF; } elseif ($route->getDefaults()) { $code .= sprintf(" \$ret = %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), ['_route' => $name]), true))); } else { - $code .= sprintf(" \$ret = array('_route' => '%s');\n", $name); + $code .= sprintf(" \$ret = ['_route' => '%s'];\n", $name); } if ($hasTrailingSlash) { @@ -331,9 +331,9 @@ EOF; $code .= <<getScheme()]); - if (!in_array($methodVariable, array('$methods'))) { + if (!in_array($methodVariable, ['$methods'])) { if (\$hasRequiredScheme) { - \$allow = array_merge(\$allow, array('$methods')); + \$allow = array_merge(\$allow, ['$methods']); } goto $gotoname; } @@ -363,8 +363,8 @@ EOF; } } elseif ($methods) { $code .= <<context; diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php index 23a93c1934..16fcc3e502 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/foo')) { // foo if (preg_match('#^/foo/(?Pbaz|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 @@ -44,9 +44,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher elseif (0 === strpos($pathinfo, '/bar')) { // bar if (preg_match('#^/bar/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); - if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { - $allow = array_merge($allow, array('GET', 'HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'bar']), array ()); + if (!in_array($canonicalMethod, ['GET', 'HEAD'])) { + $allow = array_merge($allow, ['GET', 'HEAD']); goto not_bar; } @@ -56,9 +56,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // barhead if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'barhead']), array ()); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); goto not_barhead; } @@ -72,31 +72,31 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/test/baz')) { // baz if ('/test/baz' === $pathinfo) { - return array('_route' => 'baz'); + return ['_route' => 'baz']; } // baz2 if ('/test/baz.html' === $pathinfo) { - return array('_route' => 'baz2'); + return ['_route' => 'baz2']; } // baz3 if ('/test/baz3/' === $pathinfo) { - return array('_route' => 'baz3'); + return ['_route' => 'baz3']; } } // baz4 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'baz4']), array ()); } // baz5 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz5']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); goto not_baz5; } @@ -106,9 +106,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // baz.baz6 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); - if (!in_array($requestMethod, array('PUT'))) { - $allow = array_merge($allow, array('PUT')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz.baz6']), array ()); + if (!in_array($requestMethod, ['PUT'])) { + $allow = array_merge($allow, ['PUT']); goto not_bazbaz6; } @@ -120,42 +120,42 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // quoter if (preg_match('#^/(?P[\']+)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'quoter']), array ()); } // space if ('/spa ce' === $pathinfo) { - return array('_route' => 'space'); + return ['_route' => 'space']; } if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo1']), array ()); } // bar1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar1']), array ()); } } // overridden if (preg_match('#^/a/(?P.*)$#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')) { // foo2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo2']), array ()); } // bar2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#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')) { // helloWorld if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P[^/]++))?$#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 if ('/multi/hey/' === $pathinfo) { - return array('_route' => 'hey'); + return ['_route' => 'hey']; } // overridden2 if ('/multi/new' === $pathinfo) { - return array('_route' => 'overridden2'); + return ['_route' => 'overridden2']; } } // foo3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo3']), array ()); } // bar3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#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')) { // ababa if ('/ababa' === $pathinfo) { - return array('_route' => 'ababa'); + return ['_route' => 'ababa']; } // foo4 if (preg_match('#^/aba/(?P[^/]++)$#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)) { // route1 if ('/route1' === $pathinfo) { - return array('_route' => 'route1'); + return ['_route' => 'route1']; } // route2 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)) { // route3 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)) { // route4 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)) { // route5 if ('/route5' === $pathinfo) { - return array('_route' => 'route5'); + return ['_route' => 'route5']; } } // route6 if ('/route6' === $pathinfo) { - return array('_route' => 'route6'); + return ['_route' => 'route6']; } if (preg_match('#^(?P[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) { if (0 === strpos($pathinfo, '/route1')) { // route11 if ('/route11' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route11']), array ()); } // route12 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 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P[^/]++)$#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 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P[^/]++)$#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)) { // route15 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'route15']), array ()); } } // route16 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P[^/]++)$#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 if ('/route17' === $pathinfo) { - return array('_route' => 'route17'); + return ['_route' => 'route17']; } // a if ('/a/a...' === $pathinfo) { - return array('_route' => 'a'); + return ['_route' => 'a']; } if (0 === strpos($pathinfo, '/a/b')) { // b if (preg_match('#^/a/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'b']), array ()); } // c if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'c']), array ()); } } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php index e430adb1fb..2b80be57a8 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/foo')) { // foo if (preg_match('#^/foo/(?Pbaz|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 @@ -44,9 +44,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec elseif (0 === strpos($pathinfo, '/bar')) { // bar if (preg_match('#^/bar/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); - if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { - $allow = array_merge($allow, array('GET', 'HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'bar']), array ()); + if (!in_array($canonicalMethod, ['GET', 'HEAD'])) { + $allow = array_merge($allow, ['GET', 'HEAD']); goto not_bar; } @@ -56,9 +56,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // barhead if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'barhead']), array ()); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); goto not_barhead; } @@ -72,17 +72,17 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/test/baz')) { // baz if ('/test/baz' === $pathinfo) { - return array('_route' => 'baz'); + return ['_route' => 'baz']; } // baz2 if ('/test/baz.html' === $pathinfo) { - return array('_route' => 'baz2'); + return ['_route' => 'baz2']; } // baz3 if ('/test/baz3' === $trimmedPathinfo) { - $ret = array('_route' => 'baz3'); + $ret = ['_route' => 'baz3']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -99,7 +99,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz4 if (preg_match('#^/test/(?P[^/]++)/?$#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)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -114,9 +114,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz5 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz5']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); goto not_baz5; } @@ -126,9 +126,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz.baz6 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); - if (!in_array($requestMethod, array('PUT'))) { - $allow = array_merge($allow, array('PUT')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'baz.baz6']), array ()); + if (!in_array($requestMethod, ['PUT'])) { + $allow = array_merge($allow, ['PUT']); goto not_bazbaz6; } @@ -140,42 +140,42 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // quoter if (preg_match('#^/(?P[\']+)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'quoter']), array ()); } // space if ('/spa ce' === $pathinfo) { - return array('_route' => 'space'); + return ['_route' => 'space']; } if (0 === strpos($pathinfo, '/a')) { if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo1']), array ()); } // bar1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'bar1']), array ()); } } // overridden if (preg_match('#^/a/(?P.*)$#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')) { // foo2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo2']), array ()); } // bar2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#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')) { // helloWorld if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P[^/]++))?$#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 if ('/multi/hey' === $trimmedPathinfo) { - $ret = array('_route' => 'hey'); + $ret = ['_route' => 'hey']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -205,30 +205,30 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // overridden2 if ('/multi/new' === $pathinfo) { - return array('_route' => 'overridden2'); + return ['_route' => 'overridden2']; } } // foo3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'foo3']), array ()); } // bar3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#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')) { // ababa if ('/ababa' === $pathinfo) { - return array('_route' => 'ababa'); + return ['_route' => 'ababa']; } // foo4 if (preg_match('#^/aba/(?P[^/]++)$#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)) { // route1 if ('/route1' === $pathinfo) { - return array('_route' => 'route1'); + return ['_route' => 'route1']; } // route2 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)) { // route3 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)) { // route4 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)) { // route5 if ('/route5' === $pathinfo) { - return array('_route' => 'route5'); + return ['_route' => 'route5']; } } // route6 if ('/route6' === $pathinfo) { - return array('_route' => 'route6'); + return ['_route' => 'route6']; } if (preg_match('#^(?P[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) { if (0 === strpos($pathinfo, '/route1')) { // route11 if ('/route11' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, ['_route' => 'route11']), array ()); } // route12 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 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P[^/]++)$#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 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P[^/]++)$#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)) { // route15 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'route15']), array ()); } } // route16 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P[^/]++)$#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 if ('/route17' === $pathinfo) { - return array('_route' => 'route17'); + return ['_route' => 'route17']; } // a if ('/a/a...' === $pathinfo) { - return array('_route' => 'a'); + return ['_route' => 'a']; } if (0 === strpos($pathinfo, '/a/b')) { // b if (preg_match('#^/a/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'b']), array ()); } // c if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'c']), array ()); } } // secure if ('/secure' === $pathinfo) { - $ret = array('_route' => 'secure'); + $ret = ['_route' => 'secure']; $requiredSchemes = array ( 'https' => 0,); if (!isset($requiredSchemes[$context->getScheme()])) { if ('GET' !== $canonicalMethod) { @@ -357,7 +357,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nonsecure if ('/nonsecure' === $pathinfo) { - $ret = array('_route' => 'nonsecure'); + $ret = ['_route' => 'nonsecure']; $requiredSchemes = array ( 'http' => 0,); if (!isset($requiredSchemes[$context->getScheme()])) { if ('GET' !== $canonicalMethod) { diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php index 67c4667467..03e540f696 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,19 +31,19 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/rootprefix')) { // static if ('/rootprefix/test' === $pathinfo) { - return array('_route' => 'static'); + return ['_route' => 'static']; } // dynamic if (preg_match('#^/rootprefix/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array ()); + return $this->mergeDefaults(array_replace($matches, ['_route' => 'dynamic']), array ()); } } // with-condition if ('/with-condition' === $pathinfo && ($context->getMethod() == "GET")) { - return array('_route' => 'with-condition'); + return ['_route' => 'with-condition']; } if ('/' === $pathinfo && !$allow) { diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php index ed07194a26..2585f12fe1 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher4.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -30,9 +30,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // just_head if ('/just_head' === $pathinfo) { - $ret = array('_route' => 'just_head'); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = ['_route' => 'just_head']; + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); goto not_just_head; } @@ -42,9 +42,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // head_and_get if ('/head_and_get' === $pathinfo) { - $ret = array('_route' => 'head_and_get'); - if (!in_array($canonicalMethod, array('HEAD', 'GET'))) { - $allow = array_merge($allow, array('HEAD', 'GET')); + $ret = ['_route' => 'head_and_get']; + if (!in_array($canonicalMethod, ['HEAD', 'GET'])) { + $allow = array_merge($allow, ['HEAD', 'GET']); goto not_head_and_get; } @@ -54,9 +54,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // get_and_head if ('/get_and_head' === $pathinfo) { - $ret = array('_route' => 'get_and_head'); - if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { - $allow = array_merge($allow, array('GET', 'HEAD')); + $ret = ['_route' => 'get_and_head']; + if (!in_array($canonicalMethod, ['GET', 'HEAD'])) { + $allow = array_merge($allow, ['GET', 'HEAD']); goto not_get_and_head; } @@ -66,9 +66,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // post_and_head if ('/post_and_head' === $pathinfo) { - $ret = array('_route' => 'post_and_head'); - if (!in_array($requestMethod, array('POST', 'HEAD'))) { - $allow = array_merge($allow, array('POST', 'HEAD')); + $ret = ['_route' => 'post_and_head']; + if (!in_array($requestMethod, ['POST', 'HEAD'])) { + $allow = array_merge($allow, ['POST', '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')) { // put_and_post if ('/put_and_post' === $pathinfo) { - $ret = array('_route' => 'put_and_post'); - if (!in_array($requestMethod, array('PUT', 'POST'))) { - $allow = array_merge($allow, array('PUT', 'POST')); + $ret = ['_route' => 'put_and_post']; + if (!in_array($requestMethod, ['PUT', 'POST'])) { + $allow = array_merge($allow, ['PUT', 'POST']); goto not_put_and_post; } @@ -91,9 +91,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // put_and_get_and_head if ('/put_and_post' === $pathinfo) { - $ret = array('_route' => 'put_and_get_and_head'); - if (!in_array($canonicalMethod, array('PUT', 'GET', 'HEAD'))) { - $allow = array_merge($allow, array('PUT', 'GET', 'HEAD')); + $ret = ['_route' => 'put_and_get_and_head']; + if (!in_array($canonicalMethod, ['PUT', 'GET', 'HEAD'])) { + $allow = array_merge($allow, ['PUT', 'GET', 'HEAD']); goto not_put_and_get_and_head; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php index 2b22513a61..ba0622343e 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher5.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,30 +31,30 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/a')) { // a_first if ('/a/11' === $pathinfo) { - return array('_route' => 'a_first'); + return ['_route' => 'a_first']; } // a_second if ('/a/22' === $pathinfo) { - return array('_route' => 'a_second'); + return ['_route' => 'a_second']; } // a_third if ('/a/333' === $pathinfo) { - return array('_route' => 'a_third'); + return ['_route' => 'a_third']; } } // a_wildcard if (preg_match('#^/(?P[^/]++)$#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')) { // a_fourth if ('/a/44' === $trimmedPathinfo) { - $ret = array('_route' => 'a_fourth'); + $ret = ['_route' => 'a_fourth']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -69,7 +69,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_fifth if ('/a/55' === $trimmedPathinfo) { - $ret = array('_route' => 'a_fifth'); + $ret = ['_route' => 'a_fifth']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -84,7 +84,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_sixth if ('/a/66' === $trimmedPathinfo) { - $ret = array('_route' => 'a_sixth'); + $ret = ['_route' => 'a_sixth']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -101,13 +101,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_wildcard if (0 === strpos($pathinfo, '/nested') && preg_match('#^/nested/(?P[^/]++)$#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')) { // nested_a if ('/nested/group/a' === $trimmedPathinfo) { - $ret = array('_route' => 'nested_a'); + $ret = ['_route' => 'nested_a']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -122,7 +122,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_b if ('/nested/group/b' === $trimmedPathinfo) { - $ret = array('_route' => 'nested_b'); + $ret = ['_route' => 'nested_b']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -137,7 +137,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_c if ('/nested/group/c' === $trimmedPathinfo) { - $ret = array('_route' => 'nested_c'); + $ret = ['_route' => 'nested_c']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -155,7 +155,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec elseif (0 === strpos($pathinfo, '/slashed/group')) { // slashed_a if ('/slashed/group' === $trimmedPathinfo) { - $ret = array('_route' => 'slashed_a'); + $ret = ['_route' => 'slashed_a']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -170,7 +170,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // slashed_b if ('/slashed/group/b' === $trimmedPathinfo) { - $ret = array('_route' => 'slashed_b'); + $ret = ['_route' => 'slashed_b']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -185,7 +185,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // slashed_c if ('/slashed/group/c' === $trimmedPathinfo) { - $ret = array('_route' => 'slashed_c'); + $ret = ['_route' => 'slashed_c']; if ('/' === substr($pathinfo, -1)) { // no-op } elseif ('GET' !== $canonicalMethod) { diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php index 48ecdf81c0..a668f09d9b 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher6.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,14 +31,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/trailing/simple')) { // simple_trailing_slash_no_methods 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 if ('/trailing/simple/get-method/' === $pathinfo) { - $ret = array('_route' => 'simple_trailing_slash_GET_method'); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = ['_route' => 'simple_trailing_slash_GET_method']; + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); goto not_simple_trailing_slash_GET_method; } @@ -48,9 +48,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // simple_trailing_slash_HEAD_method if ('/trailing/simple/head-method/' === $pathinfo) { - $ret = array('_route' => 'simple_trailing_slash_HEAD_method'); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = ['_route' => 'simple_trailing_slash_HEAD_method']; + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); goto not_simple_trailing_slash_HEAD_method; } @@ -60,9 +60,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // simple_trailing_slash_POST_method if ('/trailing/simple/post-method/' === $pathinfo) { - $ret = array('_route' => 'simple_trailing_slash_POST_method'); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = ['_route' => 'simple_trailing_slash_POST_method']; + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // regex_trailing_slash_no_methods if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P[^/]++)/$#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 if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_GET_method']), array ()); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); goto not_regex_trailing_slash_GET_method; } @@ -92,9 +92,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_trailing_slash_HEAD_method if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_HEAD_method']), array ()); + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); goto not_regex_trailing_slash_HEAD_method; } @@ -104,9 +104,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_trailing_slash_POST_method if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_POST_method']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // simple_not_trailing_slash_no_methods 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 if ('/not-trailing/simple/get-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_GET_method'); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = ['_route' => 'simple_not_trailing_slash_GET_method']; + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if ('/not-trailing/simple/head-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_HEAD_method'); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = ['_route' => 'simple_not_trailing_slash_HEAD_method']; + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if ('/not-trailing/simple/post-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_POST_method'); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = ['_route' => 'simple_not_trailing_slash_POST_method']; + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // regex_not_trailing_slash_no_methods if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P[^/]++)$#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 if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_GET_method']), array ()); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_HEAD_method']), array ()); + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_POST_method']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); goto not_regex_not_trailing_slash_POST_method; } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php index 81d76ea4a0..c7f8852c5d 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher7.php @@ -17,7 +17,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec public function match($rawPathinfo) { - $allow = array(); + $allow = []; $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); $context = $this->context; @@ -31,7 +31,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/trailing/simple')) { // simple_trailing_slash_no_methods 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)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -46,7 +46,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // simple_trailing_slash_GET_method 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)) { // no-op } 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')); } - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if ('/trailing/simple/head-method/' === $pathinfo) { - $ret = array('_route' => 'simple_trailing_slash_HEAD_method'); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = ['_route' => 'simple_trailing_slash_HEAD_method']; + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if ('/trailing/simple/post-method/' === $pathinfo) { - $ret = array('_route' => 'simple_trailing_slash_POST_method'); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = ['_route' => 'simple_trailing_slash_POST_method']; + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // regex_trailing_slash_no_methods if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P[^/]++)/?$#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)) { // no-op } elseif ('GET' !== $canonicalMethod) { @@ -108,7 +108,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_trailing_slash_GET_method if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P[^/]++)/?$#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)) { // no-op } 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')); } - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_HEAD_method']), array ()); + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_trailing_slash_POST_method']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // simple_not_trailing_slash_no_methods 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 if ('/not-trailing/simple/get-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_GET_method'); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = ['_route' => 'simple_not_trailing_slash_GET_method']; + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if ('/not-trailing/simple/head-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_HEAD_method'); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = ['_route' => 'simple_not_trailing_slash_HEAD_method']; + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if ('/not-trailing/simple/post-method' === $pathinfo) { - $ret = array('_route' => 'simple_not_trailing_slash_POST_method'); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = ['_route' => 'simple_not_trailing_slash_POST_method']; + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); 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')) { // regex_not_trailing_slash_no_methods if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P[^/]++)$#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 if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); - if (!in_array($canonicalMethod, array('GET'))) { - $allow = array_merge($allow, array('GET')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_GET_method']), array ()); + if (!in_array($canonicalMethod, ['GET'])) { + $allow = array_merge($allow, ['GET']); 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 if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); - if (!in_array($requestMethod, array('HEAD'))) { - $allow = array_merge($allow, array('HEAD')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_HEAD_method']), array ()); + if (!in_array($requestMethod, ['HEAD'])) { + $allow = array_merge($allow, ['HEAD']); 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 if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); - if (!in_array($requestMethod, array('POST'))) { - $allow = array_merge($allow, array('POST')); + $ret = $this->mergeDefaults(array_replace($matches, ['_route' => 'regex_not_trailing_slash_POST_method']), array ()); + if (!in_array($requestMethod, ['POST'])) { + $allow = array_merge($allow, ['POST']); goto not_regex_not_trailing_slash_POST_method; } diff --git a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php index fe2542929b..8b84d820fc 100644 --- a/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php +++ b/src/Symfony/Component/VarDumper/Tests/Fixtures/Twig.php @@ -11,11 +11,11 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig\Template parent::__construct($env); } $this->parent = false; - $this->blocks = array(); + $this->blocks = []; $this->path = $path; } - protected function doDisplay(array $context, array $blocks = array()) + protected function doDisplay(array $context, array $blocks = []) { // line 2 throw new \Exception('Foobar'); @@ -28,7 +28,7 @@ class __TwigTemplate_VarDumperFixture_u75a09 extends Twig\Template public function getDebugInfo() { - return array(20 => 1, 21 => 2); + return [20 => 1, 21 => 2]; } public function getSourceContext() diff --git a/src/Symfony/Component/VarDumper/Tests/Fixtures/dumb-var.php b/src/Symfony/Component/VarDumper/Tests/Fixtures/dumb-var.php index 59ee19bdad..de51cebc21 100644 --- a/src/Symfony/Component/VarDumper/Tests/Fixtures/dumb-var.php +++ b/src/Symfony/Component/VarDumper/Tests/Fixtures/dumb-var.php @@ -14,19 +14,19 @@ $foo->bar = 'bar'; $g = fopen(__FILE__, 'r'); -$var = array( +$var = [ 'number' => 1, null, 'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX, 'str' => "déjà\n", "\xE9\x00", - '[]' => array(), + '[]' => [], 'res' => $g, 'obj' => $foo, 'closure' => function ($a, \PDO &$b = null) {}, 'line' => __LINE__ - 1, - 'nobj' => array((object) array()), -); + 'nobj' => [(object) []], +]; -$r = array(); +$r = []; $r[] = &$r; $var['recurs'] = &$r;