Transformable.php 663 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * League.Uri (https://uri.thephpleague.com)
  4. *
  5. * (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. declare(strict_types=1);
  11. namespace League\Uri\Contracts;
  12. interface Transformable
  13. {
  14. /**
  15. * Apply a transformation to this instance and return a new instance.
  16. *
  17. * This method MUST retain the state of the current instance, and return
  18. * a new instance of the same type.
  19. *
  20. * @param callable(static): static $callback
  21. */
  22. public function transform(callable $callback): static;
  23. }