Skip to content

Commit

Permalink
Allow integer on deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jun 26, 2023
1 parent e9148fd commit 9aa0400
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Components/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use function http_build_query;
use function implode;
use function is_bool;
use function is_int;
use function iterator_to_array;
use function preg_match;
use function preg_quote;
Expand Down Expand Up @@ -136,7 +137,7 @@ public static function fromUri(Stringable|string $uri): self
*
* @param non-empty-string $separator
*/
public static function fromRFC3986(UriComponentInterface|Stringable|int|string|null $query, string $separator = '&'): self
public static function fromRFC3986(Stringable|string|null $query, string $separator = '&'): self
{
return new self($query, $separator, PHP_QUERY_RFC3986);
}
Expand All @@ -146,7 +147,7 @@ public static function fromRFC3986(UriComponentInterface|Stringable|int|string|n
*
* @param non-empty-string $separator
*/
public static function fromRFC1738(UriComponentInterface|Stringable|int|string|null $query, string $separator = '&'): self
public static function fromRFC1738(Stringable|string|null $query, string $separator = '&'): self
{
return new self($query, $separator, PHP_QUERY_RFC1738);
}
Expand Down Expand Up @@ -542,8 +543,12 @@ public static function createFromUri(Psr7UriInterface|UriInterface $uri): self
*
* @param non-empty-string $separator
*/
public static function createFromRFC3986(UriComponentInterface|Stringable|int|string|null $query = '', string $separator = '&'): self
public static function createFromRFC3986(Stringable|int|string|null $query = '', string $separator = '&'): self
{
if (is_int($query)) {
$query = (string) $query;
}

return self::fromRFC3986($query, $separator);
}

Expand All @@ -559,8 +564,12 @@ public static function createFromRFC3986(UriComponentInterface|Stringable|int|st
*
* @param non-empty-string $separator
*/
public static function createFromRFC1738(UriComponentInterface|Stringable|int|string|null $query = '', string $separator = '&'): self
public static function createFromRFC1738(Stringable|int|string|null $query = '', string $separator = '&'): self
{
if (is_int($query)) {
$query = (string) $query;
}

return self::fromRFC1738($query, $separator);
}
}

0 comments on commit 9aa0400

Please sign in to comment.