diff vendor/symfony/http-foundation/RequestMatcher.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
line wrap: on
line diff
--- a/vendor/symfony/http-foundation/RequestMatcher.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/symfony/http-foundation/RequestMatcher.php	Thu Feb 28 13:21:36 2019 +0000
@@ -31,22 +31,22 @@
     /**
      * @var string[]
      */
-    private $methods = array();
+    private $methods = [];
 
     /**
      * @var string[]
      */
-    private $ips = array();
+    private $ips = [];
 
     /**
      * @var array
      */
-    private $attributes = array();
+    private $attributes = [];
 
     /**
      * @var string[]
      */
-    private $schemes = array();
+    private $schemes = [];
 
     /**
      * @param string|null          $path
@@ -56,7 +56,7 @@
      * @param array                $attributes
      * @param string|string[]|null $schemes
      */
-    public function __construct($path = null, $host = null, $methods = null, $ips = null, array $attributes = array(), $schemes = null)
+    public function __construct($path = null, $host = null, $methods = null, $ips = null, array $attributes = [], $schemes = null)
     {
         $this->matchPath($path);
         $this->matchHost($host);
@@ -76,7 +76,7 @@
      */
     public function matchScheme($scheme)
     {
-        $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : array();
+        $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : [];
     }
 
     /**
@@ -116,7 +116,7 @@
      */
     public function matchIps($ips)
     {
-        $this->ips = null !== $ips ? (array) $ips : array();
+        $this->ips = null !== $ips ? (array) $ips : [];
     }
 
     /**
@@ -126,7 +126,7 @@
      */
     public function matchMethod($method)
     {
-        $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : array();
+        $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : [];
     }
 
     /**
@@ -145,11 +145,11 @@
      */
     public function matches(Request $request)
     {
-        if ($this->schemes && !in_array($request->getScheme(), $this->schemes, true)) {
+        if ($this->schemes && !\in_array($request->getScheme(), $this->schemes, true)) {
             return false;
         }
 
-        if ($this->methods && !in_array($request->getMethod(), $this->methods, true)) {
+        if ($this->methods && !\in_array($request->getMethod(), $this->methods, true)) {
             return false;
         }
 
@@ -173,6 +173,6 @@
 
         // Note to future implementors: add additional checks above the
         // foreach above or else your check might not be run!
-        return 0 === count($this->ips);
+        return 0 === \count($this->ips);
     }
 }