Skip to content

Commit 734a7c4

Browse files
committed
🚿
1 parent ccbecf3 commit 734a7c4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Psr7/Uri.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function getAuthority():string{
192192
* @inheritDoc
193193
*/
194194
public function getUserInfo():string{
195-
return (string)$this->user.($this->pass != '' ? ':'.$this->pass : '');
195+
return $this->user.($this->pass != '' ? ':'.$this->pass : '');
196196
}
197197

198198
/**
@@ -283,6 +283,7 @@ protected function filterPort($port):?int{
283283
}
284284

285285
$port = (int)$port;
286+
286287
if($port >= 1 && $port <= 0xffff){
287288
return $port;
288289
}
@@ -468,12 +469,10 @@ protected function parseUriParts(array $parts):void{
468469
* @return string
469470
*/
470471
protected function replaceChars(string $str, bool $query = null):string{
471-
/** @noinspection RegExpRedundantEscape */
472+
/** @noinspection RegExpRedundantEscape, RegExpUnnecessaryNonCapturingGroup */
472473
return preg_replace_callback(
473474
'/(?:[^a-z\d_\-\.~!\$&\'\(\)\*\+,;=%:@\/'.($query ? '\?' : '').']++|%(?![a-f\d]{2}))/i',
474-
function(array $match):string{
475-
return rawurlencode($match[0]);
476-
},
475+
fn(array $match):string => rawurlencode($match[0]),
477476
$str
478477
);
479478

0 commit comments

Comments
 (0)