NamespacedPoolInterface.php 874 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.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. namespace Symfony\Contracts\Cache;
  11. use Psr\Cache\InvalidArgumentException;
  12. /**
  13. * Enables namespace-based invalidation by prefixing keys with backend-native namespace separators.
  14. *
  15. * Note that calling `withSubNamespace()` MUST NOT mutate the pool, but return a new instance instead.
  16. *
  17. * When tags are used, they MUST ignore sub-namespaces.
  18. *
  19. * @author Nicolas Grekas <p@tchwork.com>
  20. */
  21. interface NamespacedPoolInterface
  22. {
  23. /**
  24. * @throws InvalidArgumentException If the namespace contains characters found in ItemInterface's RESERVED_CHARACTERS
  25. */
  26. public function withSubNamespace(string $namespace): static;
  27. }