diff vendor/zendframework/zend-diactoros/src/Uri.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children 129ea1e6d783
line wrap: on
line diff
--- a/vendor/zendframework/zend-diactoros/src/Uri.php	Thu Apr 26 11:26:54 2018 +0100
+++ b/vendor/zendframework/zend-diactoros/src/Uri.php	Tue Jul 10 15:07:59 2018 +0100
@@ -10,6 +10,26 @@
 use InvalidArgumentException;
 use Psr\Http\Message\UriInterface;
 
+use function array_key_exists;
+use function array_keys;
+use function count;
+use function explode;
+use function get_class;
+use function gettype;
+use function implode;
+use function is_numeric;
+use function is_object;
+use function is_string;
+use function ltrim;
+use function parse_url;
+use function preg_replace;
+use function preg_replace_callback;
+use function rawurlencode;
+use function sprintf;
+use function strpos;
+use function strtolower;
+use function substr;
+
 /**
  * Implementation of Psr\Http\UriInterface.
  *
@@ -98,7 +118,7 @@
             ));
         }
 
-        if (! empty($uri)) {
+        if ('' !== $uri) {
             $this->parseUri($uri);
         }
     }
@@ -147,12 +167,12 @@
      */
     public function getAuthority()
     {
-        if (empty($this->host)) {
+        if ('' === $this->host) {
             return '';
         }
 
         $authority = $this->host;
-        if (! empty($this->userInfo)) {
+        if ('' !== $this->userInfo) {
             $authority = $this->userInfo . '@' . $authority;
         }
 
@@ -476,27 +496,26 @@
     {
         $uri = '';
 
-        if (! empty($scheme)) {
+        if ('' !== $scheme) {
             $uri .= sprintf('%s:', $scheme);
         }
 
-        if (! empty($authority)) {
+        if ('' !== $authority) {
             $uri .= '//' . $authority;
         }
 
-        if ($path) {
-            if (empty($path) || '/' !== substr($path, 0, 1)) {
-                $path = '/' . $path;
-            }
-
-            $uri .= $path;
+        if ('' !== $path && '/' !== substr($path, 0, 1)) {
+            $path = '/' . $path;
         }
 
-        if ($query) {
+        $uri .= $path;
+
+
+        if ('' !== $query) {
             $uri .= sprintf('?%s', $query);
         }
 
-        if ($fragment) {
+        if ('' !== $fragment) {
             $uri .= sprintf('#%s', $fragment);
         }
 
@@ -513,14 +532,11 @@
      */
     private function isNonStandardPort($scheme, $host, $port)
     {
-        if (! $scheme) {
-            if ($host && ! $port) {
-                return false;
-            }
-            return true;
+        if ('' === $scheme) {
+            return '' === $host || null !== $port;
         }
 
-        if (! $host || ! $port) {
+        if ('' === $host || null === $port) {
             return false;
         }
 
@@ -539,7 +555,7 @@
         $scheme = strtolower($scheme);
         $scheme = preg_replace('#:(//)?$#', '', $scheme);
 
-        if (empty($scheme)) {
+        if ('' === $scheme) {
             return '';
         }
 
@@ -585,7 +601,7 @@
             $path
         );
 
-        if (empty($path)) {
+        if ('' === $path) {
             // No path
             return $path;
         }
@@ -609,7 +625,7 @@
      */
     private function filterQuery($query)
     {
-        if (! empty($query) && strpos($query, '?') === 0) {
+        if ('' !== $query && strpos($query, '?') === 0) {
             $query = substr($query, 1);
         }
 
@@ -653,7 +669,7 @@
      */
     private function filterFragment($fragment)
     {
-        if (! empty($fragment) && strpos($fragment, '#') === 0) {
+        if ('' !== $fragment && strpos($fragment, '#') === 0) {
             $fragment = '%23' . substr($fragment, 1);
         }