@@ -387,7 +387,7 @@ public function parseUrl(string $url, int $component = -1): array
387387 {
388388 $ encodedUrl = preg_replace_callback (
389389 '/[^:\/@?&=#]+/u ' ,
390- static function ($ matches ) {
390+ static function ($ matches ): string {
391391 return urlencode ($ matches [0 ]);
392392 },
393393 $ url
@@ -414,7 +414,7 @@ public static function arrayToParams(array $getParams = [], bool $includeEmpty =
414414 if (count ($ getParams ) !== 0 ) {
415415
416416 if ($ includeEmpty === false ) {
417- $ getParams = array_filter ($ getParams , static function ($ item ) {
417+ $ getParams = array_filter ($ getParams , static function ($ item ): bool {
418418 return (trim ($ item ) !== '' );
419419 });
420420 }
@@ -458,15 +458,15 @@ public function getAbsoluteUrl(bool $includeParams = true): string
458458 $ port = $ this ->port !== null ? ': ' . $ this ->port : '' ;
459459 $ user = $ this ->username ?? '' ;
460460 $ pass = $ this ->password !== null ? ': ' . $ this ->password : '' ;
461- $ pass = ($ user || $ pass ) ? $ pass . '@ ' : '' ;
461+ $ pass = ($ user !== '' || $ pass !== '' ) ? $ pass . '@ ' : '' ;
462462
463463 return $ scheme . $ user . $ pass . $ host . $ port . $ this ->getRelativeUrl ($ includeParams );
464464 }
465465
466466 /**
467467 * Specify data which should be serialized to JSON
468468 * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
469- * @return mixed data which can be serialized by <b>json_encode</b>,
469+ * @return string data which can be serialized by <b>json_encode</b>,
470470 * which is a value of any type other than a resource.
471471 * @since 5.4.0
472472 */
0 commit comments