Skip to content

Commit 8b5ffce

Browse files
committed
Replace tap by transform
1 parent b9284ab commit 8b5ffce

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Components/URLSearchParams.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Iterator;
2222
use IteratorAggregate;
2323
use League\Uri\Contracts\QueryInterface;
24+
use League\Uri\Contracts\Transformable;
2425
use League\Uri\Contracts\UriComponentInterface;
2526
use League\Uri\Contracts\UriException;
2627
use League\Uri\Contracts\UriInterface;
@@ -57,7 +58,7 @@
5758
*
5859
* @implements IteratorAggregate<array{0:string, 1:string}>
5960
*/
60-
final class URLSearchParams implements Countable, IteratorAggregate, UriComponentInterface
61+
final class URLSearchParams implements Countable, IteratorAggregate, UriComponentInterface, Transformable
6162
{
6263
private QueryInterface $pairs;
6364

@@ -583,13 +584,11 @@ public function when(callable|bool $condition, callable $onSuccess, ?callable $o
583584
* Executes the given callback with the current instance
584585
* and returns the current instance.
585586
*
586-
* @param callable(self): void $callback
587+
* @param callable(self): self $callback
587588
*/
588-
public function tap(callable $callback): self
589+
public function transform(callable $callback): static
589590
{
590-
$callback($this);
591-
592-
return $this;
591+
return $callback($this);
593592
}
594593

595594
/**

0 commit comments

Comments
 (0)