summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache-contracts/ItemInterface.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/symfony/cache-contracts/ItemInterface.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/symfony/cache-contracts/ItemInterface.php')
-rw-r--r--vendor/symfony/cache-contracts/ItemInterface.php65
1 files changed, 65 insertions, 0 deletions
diff --git a/vendor/symfony/cache-contracts/ItemInterface.php b/vendor/symfony/cache-contracts/ItemInterface.php
new file mode 100644
index 0000000..8c4c512
--- /dev/null
+++ b/vendor/symfony/cache-contracts/ItemInterface.php
@@ -0,0 +1,65 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Contracts\Cache;
13
14use Psr\Cache\CacheException;
15use Psr\Cache\CacheItemInterface;
16use Psr\Cache\InvalidArgumentException;
17
18/**
19 * Augments PSR-6's CacheItemInterface with support for tags and metadata.
20 *
21 * @author Nicolas Grekas <p@tchwork.com>
22 */
23interface ItemInterface extends CacheItemInterface
24{
25 /**
26 * References the Unix timestamp stating when the item will expire.
27 */
28 public const METADATA_EXPIRY = 'expiry';
29
30 /**
31 * References the time the item took to be created, in milliseconds.
32 */
33 public const METADATA_CTIME = 'ctime';
34
35 /**
36 * References the list of tags that were assigned to the item, as string[].
37 */
38 public const METADATA_TAGS = 'tags';
39
40 /**
41 * Reserved characters that cannot be used in a key or tag.
42 */
43 public const RESERVED_CHARACTERS = '{}()/\@:';
44
45 /**
46 * Adds a tag to a cache item.
47 *
48 * Tags are strings that follow the same validation rules as keys.
49 *
50 * @param string|string[] $tags A tag or array of tags
51 *
52 * @return $this
53 *
54 * @throws InvalidArgumentException When $tag is not valid
55 * @throws CacheException When the item comes from a pool that is not tag-aware
56 */
57 public function tag(string|iterable $tags): static;
58
59 /**
60 * Returns a list of metadata info that were saved alongside with the cached value.
61 *
62 * See ItemInterface::METADATA_* consts for keys potentially found in the returned array.
63 */
64 public function getMetadata(): array;
65}