Skip to content

Commit

Permalink
bug #54528 [HttpFoundation] defer addition of new method argument to …
Browse files Browse the repository at this point in the history
…8.0 (xabbuh)

This PR was merged into the 7.1 branch.

Discussion
----------

[HttpFoundation] defer addition of new method argument to 8.0

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #51502 (comment)
| License       | MIT

Commits
-------

8fadaca defer addition of new method argument to 8.0
  • Loading branch information
fabpot committed Apr 9, 2024
2 parents ce408ab + 8fadaca commit 6cd69fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Symfony/Component/HttpFoundation/UriSigner.php
Expand Up @@ -51,8 +51,18 @@ public function __construct(#[\SensitiveParameter] string $secret, string $hashP
*
* The expiration is added as a query string parameter.
*/
public function sign(string $uri, \DateTimeInterface|\DateInterval|int|null $expiration = null): string
public function sign(string $uri/*, \DateTimeInterface|\DateInterval|int|null $expiration = null*/): string
{
$expiration = null;

if (1 < \func_num_args()) {
$expiration = func_get_arg(1);
}

if (null !== $expiration && !$expiration instanceof \DateTimeInterface && !$expiration instanceof \DateInterval && !\is_int($expiration)) {
throw new \TypeError(sprintf('The second argument of %s() must be an instance of %s or %s, an integer or null (%s given).', __METHOD__, \DateTimeInterface::class, \DateInterval::class, get_debug_type($expiration)));
}

$url = parse_url($uri);
$params = [];

Expand Down

0 comments on commit 6cd69fd

Please sign in to comment.