@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $uri_userinfo = parent::toUriString(); //returns data string |
| 56 | 56 | |
| 57 | 57 | if (!empty($uri_userinfo)) { |
| 58 | - $uri_userinfo = $uri_userinfo . "@"; |
|
| 58 | + $uri_userinfo = $uri_userinfo."@"; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return $uri_userinfo; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | /** |
| 48 | 48 | * Validates a given port. A port is valid if it is either null or an integer between 1 and 65535 inclusive. |
| 49 | 49 | * |
| 50 | - * @param mixed $port The port to be validated |
|
| 50 | + * @param integer|null $port The port to be validated |
|
| 51 | 51 | * @return bool Returns true if the given port is valid |
| 52 | 52 | * Returns false otherwise |
| 53 | 53 | */ |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | $uri_string = (string) $normalized_port; |
| 93 | 93 | |
| 94 | 94 | if (!is_null($normalized_port)) { |
| 95 | - $uri_string = ":" . $uri_string; |
|
| 95 | + $uri_string = ":".$uri_string; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return $uri_string; |
@@ -162,18 +162,18 @@ |
||
| 162 | 162 | $valid_characters = implode(static::$unencoded_characters); |
| 163 | 163 | |
| 164 | 164 | if (empty(static::$part_pattern)) { |
| 165 | - static::$part_pattern = '([\w'; //start decoded group |
|
| 165 | + static::$part_pattern = '([\w'; //start decoded group |
|
| 166 | 166 | |
| 167 | - static::$part_pattern = static::$part_pattern . preg_quote($valid_characters, "/"); |
|
| 167 | + static::$part_pattern = static::$part_pattern.preg_quote($valid_characters, "/"); |
|
| 168 | 168 | |
| 169 | - static::$part_pattern = static::$part_pattern . |
|
| 170 | - ']|' . //predefined patterns or percent-encoding |
|
| 171 | - self::$pct_encoded_pattern . |
|
| 169 | + static::$part_pattern = static::$part_pattern. |
|
| 170 | + ']|'.//predefined patterns or percent-encoding |
|
| 171 | + self::$pct_encoded_pattern. |
|
| 172 | 172 | ')*'; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | - static::$valid_pattern = '/^$|^' . //allows part to be empty |
|
| 176 | - static::$part_pattern . |
|
| 175 | + static::$valid_pattern = '/^$|^'.//allows part to be empty |
|
| 176 | + static::$part_pattern. |
|
| 177 | 177 | '$/'; |
| 178 | 178 | } |
| 179 | 179 | |
@@ -78,15 +78,15 @@ |
||
| 78 | 78 | { |
| 79 | 79 | self::compileUnencodedCharacters(); |
| 80 | 80 | |
| 81 | - $valid_characters = self::$unreserved_pattern . self::$sub_delims_pattern; |
|
| 81 | + $valid_characters = self::$unreserved_pattern.self::$sub_delims_pattern; |
|
| 82 | 82 | |
| 83 | - $ip_v_future_pattern = '\[[\:' . $valid_characters . ']+\]'; |
|
| 83 | + $ip_v_future_pattern = '\[[\:'.$valid_characters.']+\]'; |
|
| 84 | 84 | |
| 85 | - $reg_name_pattern = '([' . $valid_characters . ']|' . self::$pct_encoded_pattern . ')*'; |
|
| 85 | + $reg_name_pattern = '(['.$valid_characters.']|'.self::$pct_encoded_pattern.')*'; |
|
| 86 | 86 | |
| 87 | - self::$part_pattern = $ip_v_future_pattern . '|'. $reg_name_pattern; |
|
| 87 | + self::$part_pattern = $ip_v_future_pattern.'|'.$reg_name_pattern; |
|
| 88 | 88 | |
| 89 | - self::$valid_pattern = '/^$|^' . //allows part to be empty |
|
| 90 | - $ip_v_future_pattern . '$|^' . $reg_name_pattern . '$/'; |
|
| 89 | + self::$valid_pattern = '/^$|^'.//allows part to be empty |
|
| 90 | + $ip_v_future_pattern.'$|^'.$reg_name_pattern.'$/'; |
|
| 91 | 91 | } |
| 92 | 92 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function __toString() |
| 102 | 102 | { |
| 103 | - return $this->user_info->toUriString() . $this->host->toUriString() . $this->port->toUriString(); |
|
| 103 | + return $this->user_info->toUriString().$this->host->toUriString().$this->port->toUriString(); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function toUriString(Scheme $scheme = null) |
| 129 | 129 | { |
| 130 | - $authority_string = $this->user_info->toUriString() . |
|
| 131 | - $this->host->toUriString() . |
|
| 130 | + $authority_string = $this->user_info->toUriString(). |
|
| 131 | + $this->host->toUriString(). |
|
| 132 | 132 | $this->port->toUriString($scheme); |
| 133 | 133 | |
| 134 | 134 | if (!empty($authority_string)) { |
| 135 | - $authority_string = "//" . $authority_string; |
|
| 135 | + $authority_string = "//".$authority_string; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | return $authority_string; |
@@ -149,15 +149,15 @@ discard block |
||
| 149 | 149 | $host_pattern = Host::getValidPattern(); |
| 150 | 150 | $port_pattern = Port::getValidPattern(); |
| 151 | 151 | |
| 152 | - $reg_start = '/^$|^'; //allow for empty authority |
|
| 152 | + $reg_start = '/^$|^'; //allow for empty authority |
|
| 153 | 153 | $reg_end = '$/'; |
| 154 | 154 | |
| 155 | 155 | self::$part_pattern = |
| 156 | - '((?\'user_info\'' . $user_info_pattern . ')@)?' . |
|
| 157 | - '(?\'host\'' . $host_pattern . ')' . |
|
| 158 | - '(:(?\'port\'' . $port_pattern . '))?'; |
|
| 156 | + '((?\'user_info\''.$user_info_pattern.')@)?'. |
|
| 157 | + '(?\'host\''.$host_pattern.')'. |
|
| 158 | + '(:(?\'port\''.$port_pattern.'))?'; |
|
| 159 | 159 | |
| 160 | - self::$valid_pattern = $reg_start . self::$part_pattern . $reg_end; |
|
| 160 | + self::$valid_pattern = $reg_start.self::$part_pattern.$reg_end; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $port_part = '(?::(?\'port\'[0-9]+))?'; |
| 179 | 179 | $reg_end = '/'; |
| 180 | 180 | |
| 181 | - $authority_syntax = $reg_start . $user_info_part . $host_part . $port_part . $reg_end; |
|
| 181 | + $authority_syntax = $reg_start.$user_info_part.$host_part.$port_part.$reg_end; |
|
| 182 | 182 | |
| 183 | 183 | preg_match($authority_syntax, $authority, $authority_parts); |
| 184 | 184 | |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | |
| 89 | 89 | if (!empty((string) $authority)) { |
| 90 | 90 | if (!$path_string->startsWith("/")) { |
| 91 | - $path_string = "/" . $this->data; |
|
| 91 | + $path_string = "/".$this->data; |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function getAuthority() |
| 109 | 109 | { |
| 110 | - return $this->user_info->toUriString() . $this->host->toUriString() . $this->port->toUriString($this->scheme); |
|
| 110 | + return $this->user_info->toUriString().$this->host->toUriString().$this->port->toUriString($this->scheme); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -317,14 +317,14 @@ discard block |
||
| 317 | 317 | public function withUserInfo($user, $password = null) |
| 318 | 318 | { |
| 319 | 319 | if (!empty($password)) { |
| 320 | - $user_info = $user . ":" . $password; |
|
| 320 | + $user_info = $user.":".$password; |
|
| 321 | 321 | } else { |
| 322 | 322 | $user_info = $user; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | $with_user_info = new UserInfo($user_info); |
| 326 | 326 | |
| 327 | - $authority_string = $with_user_info->toUriString() . $this->host->toUriString() . $this->port->toUriString(); |
|
| 327 | + $authority_string = $with_user_info->toUriString().$this->host->toUriString().$this->port->toUriString(); |
|
| 328 | 328 | |
| 329 | 329 | $new_user_info_uri = $this->withAuthority($authority_string); |
| 330 | 330 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $with_host_port = $this->port->toUriString(); |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $authority_string = $with_host_user_info . $with_host->toUriString() . $with_host_port; |
|
| 358 | + $authority_string = $with_host_user_info.$with_host->toUriString().$with_host_port; |
|
| 359 | 359 | |
| 360 | 360 | $new_host_uri = $this->withAuthority($authority_string); |
| 361 | 361 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | { |
| 384 | 384 | $with_port = new Port($port); |
| 385 | 385 | |
| 386 | - $authority_string = $this->user_info->toUriString() . $this->host->toUriString() . $with_port->toUriString(); |
|
| 386 | + $authority_string = $this->user_info->toUriString().$this->host->toUriString().$with_port->toUriString(); |
|
| 387 | 387 | |
| 388 | 388 | $new_port_uri = $this->withAuthority($authority_string); |
| 389 | 389 | |
@@ -517,8 +517,7 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | private function explodeUri($uri) |
| 519 | 519 | { |
| 520 | - $uri_parts = array |
|
| 521 | - ( |
|
| 520 | + $uri_parts = array( |
|
| 522 | 521 | "scheme" => "", |
| 523 | 522 | "hier_part" => "", |
| 524 | 523 | "authority" => "", |
@@ -553,7 +552,7 @@ discard block |
||
| 553 | 552 | $fragment_part = '(?:#(?\'fragment\'.*))?'; |
| 554 | 553 | $reg_end = '/'; |
| 555 | 554 | |
| 556 | - return $reg_start . $scheme_part . $authority_part . $path_part . $query_part . $fragment_part . $reg_end; |
|
| 555 | + return $reg_start.$scheme_part.$authority_part.$path_part.$query_part.$fragment_part.$reg_end; |
|
| 557 | 556 | } |
| 558 | 557 | |
| 559 | 558 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * Returns true if the stream is at the end of the stream. |
| 83 | 83 | * |
| 84 | - * @return bool |
|
| 84 | + * @return boolean|null |
|
| 85 | 85 | */ |
| 86 | 86 | public function eof() |
| 87 | 87 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * Returns whether or not the stream is seekable. |
| 93 | 93 | * |
| 94 | - * @return bool |
|
| 94 | + * @return boolean|null |
|
| 95 | 95 | */ |
| 96 | 96 | public function isSeekable() |
| 97 | 97 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * Returns whether or not the stream is writable. |
| 135 | 135 | * |
| 136 | - * @return bool |
|
| 136 | + * @return boolean|null |
|
| 137 | 137 | */ |
| 138 | 138 | public function isWritable() |
| 139 | 139 | { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | /** |
| 156 | 156 | * Returns whether or not the stream is readable. |
| 157 | 157 | * |
| 158 | - * @return bool |
|
| 158 | + * @return boolean|null |
|
| 159 | 159 | */ |
| 160 | 160 | public function isReadable() |
| 161 | 161 | { |