Skip to content

Commit

Permalink
TASK: Add types to UriHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Mar 28, 2024
1 parent 3da3790 commit 26c28aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Neos.Flow/Classes/Http/Helper/UriHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private function __construct()
}

/**
* @var array
* @var array<string, int>
*/
private static $defaultPortsByScheme = [
'http' => 80,
Expand All @@ -45,14 +45,14 @@ private function __construct()
* Returns the path relative to the $baseUri
*
* @param UriInterface $baseUri The base URI to start from
* @param UriInterface $uri The URI in quesiton
* @param UriInterface $uri The URI in question
* @return string
*/
public static function getRelativePath(UriInterface $baseUri, UriInterface $uri): string
{
$baseUriString = (string)$baseUri;
$uriString = (string)$uri;
if (empty($baseUriString) || strpos($uriString, $baseUriString) !== 0) {
if (empty($baseUriString) || !str_starts_with($uriString, $baseUriString)) {
return '';
}

Expand All @@ -63,7 +63,7 @@ public static function getRelativePath(UriInterface $baseUri, UriInterface $uri)
/**
* Sets and replaces the query parameters.
*
* @param array $queryParameters
* @param array<string, mixed> $queryParameters
* @return UriInterface A new instance with the replaced query parameters.
*/
public static function uriWithQueryParameters(UriInterface $uri, array $queryParameters): UriInterface
Expand All @@ -75,7 +75,7 @@ public static function uriWithQueryParameters(UriInterface $uri, array $queryPar
/**
* Merges the additional query parameters recursively into the current query parameters.
*
* @param array $queryParameters
* @param array<string, mixed> $queryParameters
* @return UriInterface A new instance with the additional query parameters.
*/
public static function uriWithAdditionalQueryParameters(UriInterface $uri, array $queryParameters): UriInterface
Expand Down

0 comments on commit 26c28aa

Please sign in to comment.