diff options
author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/psr/cache/src | |
parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/psr/cache/src')
-rw-r--r-- | vendor/psr/cache/src/CacheException.php | 10 | ||||
-rw-r--r-- | vendor/psr/cache/src/CacheItemInterface.php | 105 | ||||
-rw-r--r-- | vendor/psr/cache/src/CacheItemPoolInterface.php | 138 | ||||
-rw-r--r-- | vendor/psr/cache/src/InvalidArgumentException.php | 13 |
4 files changed, 266 insertions, 0 deletions
diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php new file mode 100644 index 0000000..bb785f4 --- /dev/null +++ b/vendor/psr/cache/src/CacheException.php | |||
@@ -0,0 +1,10 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Psr\Cache; | ||
4 | |||
5 | /** | ||
6 | * Exception interface for all exceptions thrown by an Implementing Library. | ||
7 | */ | ||
8 | interface CacheException extends \Throwable | ||
9 | { | ||
10 | } | ||
diff --git a/vendor/psr/cache/src/CacheItemInterface.php b/vendor/psr/cache/src/CacheItemInterface.php new file mode 100644 index 0000000..2b2e4bb --- /dev/null +++ b/vendor/psr/cache/src/CacheItemInterface.php | |||
@@ -0,0 +1,105 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Psr\Cache; | ||
4 | |||
5 | /** | ||
6 | * CacheItemInterface defines an interface for interacting with objects inside a cache. | ||
7 | * | ||
8 | * Each Item object MUST be associated with a specific key, which can be set | ||
9 | * according to the implementing system and is typically passed by the | ||
10 | * Cache\CacheItemPoolInterface object. | ||
11 | * | ||
12 | * The Cache\CacheItemInterface object encapsulates the storage and retrieval of | ||
13 | * cache items. Each Cache\CacheItemInterface is generated by a | ||
14 | * Cache\CacheItemPoolInterface object, which is responsible for any required | ||
15 | * setup as well as associating the object with a unique Key. | ||
16 | * Cache\CacheItemInterface objects MUST be able to store and retrieve any type | ||
17 | * of PHP value defined in the Data section of the specification. | ||
18 | * | ||
19 | * Calling Libraries MUST NOT instantiate Item objects themselves. They may only | ||
20 | * be requested from a Pool object via the getItem() method. Calling Libraries | ||
21 | * SHOULD NOT assume that an Item created by one Implementing Library is | ||
22 | * compatible with a Pool from another Implementing Library. | ||
23 | */ | ||
24 | interface CacheItemInterface | ||
25 | { | ||
26 | /** | ||
27 | * Returns the key for the current cache item. | ||
28 | * | ||
29 | * The key is loaded by the Implementing Library, but should be available to | ||
30 | * the higher level callers when needed. | ||
31 | * | ||
32 | * @return string | ||
33 | * The key string for this cache item. | ||
34 | */ | ||
35 | public function getKey(): string; | ||
36 | |||
37 | /** | ||
38 | * Retrieves the value of the item from the cache associated with this object's key. | ||
39 | * | ||
40 | * The value returned must be identical to the value originally stored by set(). | ||
41 | * | ||
42 | * If isHit() returns false, this method MUST return null. Note that null | ||
43 | * is a legitimate cached value, so the isHit() method SHOULD be used to | ||
44 | * differentiate between "null value was found" and "no value was found." | ||
45 | * | ||
46 | * @return mixed | ||
47 | * The value corresponding to this cache item's key, or null if not found. | ||
48 | */ | ||
49 | public function get(): mixed; | ||
50 | |||
51 | /** | ||
52 | * Confirms if the cache item lookup resulted in a cache hit. | ||
53 | * | ||
54 | * Note: This method MUST NOT have a race condition between calling isHit() | ||
55 | * and calling get(). | ||
56 | * | ||
57 | * @return bool | ||
58 | * True if the request resulted in a cache hit. False otherwise. | ||
59 | */ | ||
60 | public function isHit(): bool; | ||
61 | |||
62 | /** | ||
63 | * Sets the value represented by this cache item. | ||
64 | * | ||
65 | * The $value argument may be any item that can be serialized by PHP, | ||
66 | * although the method of serialization is left up to the Implementing | ||
67 | * Library. | ||
68 | * | ||
69 | * @param mixed $value | ||
70 | * The serializable value to be stored. | ||
71 | * | ||
72 | * @return static | ||
73 | * The invoked object. | ||
74 | */ | ||
75 | public function set(mixed $value): static; | ||
76 | |||
77 | /** | ||
78 | * Sets the expiration time for this cache item. | ||
79 | * | ||
80 | * @param ?\DateTimeInterface $expiration | ||
81 | * The point in time after which the item MUST be considered expired. | ||
82 | * If null is passed explicitly, a default value MAY be used. If none is set, | ||
83 | * the value should be stored permanently or for as long as the | ||
84 | * implementation allows. | ||
85 | * | ||
86 | * @return static | ||
87 | * The called object. | ||
88 | */ | ||
89 | public function expiresAt(?\DateTimeInterface $expiration): static; | ||
90 | |||
91 | /** | ||
92 | * Sets the expiration time for this cache item. | ||
93 | * | ||
94 | * @param int|\DateInterval|null $time | ||
95 | * The period of time from the present after which the item MUST be considered | ||
96 | * expired. An integer parameter is understood to be the time in seconds until | ||
97 | * expiration. If null is passed explicitly, a default value MAY be used. | ||
98 | * If none is set, the value should be stored permanently or for as long as the | ||
99 | * implementation allows. | ||
100 | * | ||
101 | * @return static | ||
102 | * The called object. | ||
103 | */ | ||
104 | public function expiresAfter(int|\DateInterval|null $time): static; | ||
105 | } | ||
diff --git a/vendor/psr/cache/src/CacheItemPoolInterface.php b/vendor/psr/cache/src/CacheItemPoolInterface.php new file mode 100644 index 0000000..4b3017c --- /dev/null +++ b/vendor/psr/cache/src/CacheItemPoolInterface.php | |||
@@ -0,0 +1,138 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Psr\Cache; | ||
4 | |||
5 | /** | ||
6 | * CacheItemPoolInterface generates CacheItemInterface objects. | ||
7 | * | ||
8 | * The primary purpose of Cache\CacheItemPoolInterface is to accept a key from | ||
9 | * the Calling Library and return the associated Cache\CacheItemInterface object. | ||
10 | * It is also the primary point of interaction with the entire cache collection. | ||
11 | * All configuration and initialization of the Pool is left up to an | ||
12 | * Implementing Library. | ||
13 | */ | ||
14 | interface CacheItemPoolInterface | ||
15 | { | ||
16 | /** | ||
17 | * Returns a Cache Item representing the specified key. | ||
18 | * | ||
19 | * This method must always return a CacheItemInterface object, even in case of | ||
20 | * a cache miss. It MUST NOT return null. | ||
21 | * | ||
22 | * @param string $key | ||
23 | * The key for which to return the corresponding Cache Item. | ||
24 | * | ||
25 | * @throws InvalidArgumentException | ||
26 | * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException | ||
27 | * MUST be thrown. | ||
28 | * | ||
29 | * @return CacheItemInterface | ||
30 | * The corresponding Cache Item. | ||
31 | */ | ||
32 | public function getItem(string $key): CacheItemInterface; | ||
33 | |||
34 | /** | ||
35 | * Returns a traversable set of cache items. | ||
36 | * | ||
37 | * @param string[] $keys | ||
38 | * An indexed array of keys of items to retrieve. | ||
39 | * | ||
40 | * @throws InvalidArgumentException | ||
41 | * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException | ||
42 | * MUST be thrown. | ||
43 | * | ||
44 | * @return iterable | ||
45 | * An iterable collection of Cache Items keyed by the cache keys of | ||
46 | * each item. A Cache item will be returned for each key, even if that | ||
47 | * key is not found. However, if no keys are specified then an empty | ||
48 | * traversable MUST be returned instead. | ||
49 | */ | ||
50 | public function getItems(array $keys = []): iterable; | ||
51 | |||
52 | /** | ||
53 | * Confirms if the cache contains specified cache item. | ||
54 | * | ||
55 | * Note: This method MAY avoid retrieving the cached value for performance reasons. | ||
56 | * This could result in a race condition with CacheItemInterface::get(). To avoid | ||
57 | * such situation use CacheItemInterface::isHit() instead. | ||
58 | * | ||
59 | * @param string $key | ||
60 | * The key for which to check existence. | ||
61 | * | ||
62 | * @throws InvalidArgumentException | ||
63 | * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException | ||
64 | * MUST be thrown. | ||
65 | * | ||
66 | * @return bool | ||
67 | * True if item exists in the cache, false otherwise. | ||
68 | */ | ||
69 | public function hasItem(string $key): bool; | ||
70 | |||
71 | /** | ||
72 | * Deletes all items in the pool. | ||
73 | * | ||
74 | * @return bool | ||
75 | * True if the pool was successfully cleared. False if there was an error. | ||
76 | */ | ||
77 | public function clear(): bool; | ||
78 | |||
79 | /** | ||
80 | * Removes the item from the pool. | ||
81 | * | ||
82 | * @param string $key | ||
83 | * The key to delete. | ||
84 | * | ||
85 | * @throws InvalidArgumentException | ||
86 | * If the $key string is not a legal value a \Psr\Cache\InvalidArgumentException | ||
87 | * MUST be thrown. | ||
88 | * | ||
89 | * @return bool | ||
90 | * True if the item was successfully removed. False if there was an error. | ||
91 | */ | ||
92 | public function deleteItem(string $key): bool; | ||
93 | |||
94 | /** | ||
95 | * Removes multiple items from the pool. | ||
96 | * | ||
97 | * @param string[] $keys | ||
98 | * An array of keys that should be removed from the pool. | ||
99 | * | ||
100 | * @throws InvalidArgumentException | ||
101 | * If any of the keys in $keys are not a legal value a \Psr\Cache\InvalidArgumentException | ||
102 | * MUST be thrown. | ||
103 | * | ||
104 | * @return bool | ||
105 | * True if the items were successfully removed. False if there was an error. | ||
106 | */ | ||
107 | public function deleteItems(array $keys): bool; | ||
108 | |||
109 | /** | ||
110 | * Persists a cache item immediately. | ||
111 | * | ||
112 | * @param CacheItemInterface $item | ||
113 | * The cache item to save. | ||
114 | * | ||
115 | * @return bool | ||
116 | * True if the item was successfully persisted. False if there was an error. | ||
117 | */ | ||
118 | public function save(CacheItemInterface $item): bool; | ||
119 | |||
120 | /** | ||
121 | * Sets a cache item to be persisted later. | ||
122 | * | ||
123 | * @param CacheItemInterface $item | ||
124 | * The cache item to save. | ||
125 | * | ||
126 | * @return bool | ||
127 | * False if the item could not be queued or if a commit was attempted and failed. True otherwise. | ||
128 | */ | ||
129 | public function saveDeferred(CacheItemInterface $item): bool; | ||
130 | |||
131 | /** | ||
132 | * Persists any deferred cache items. | ||
133 | * | ||
134 | * @return bool | ||
135 | * True if all not-yet-saved items were successfully saved or there were none. False otherwise. | ||
136 | */ | ||
137 | public function commit(): bool; | ||
138 | } | ||
diff --git a/vendor/psr/cache/src/InvalidArgumentException.php b/vendor/psr/cache/src/InvalidArgumentException.php new file mode 100644 index 0000000..be7c6fa --- /dev/null +++ b/vendor/psr/cache/src/InvalidArgumentException.php | |||
@@ -0,0 +1,13 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Psr\Cache; | ||
4 | |||
5 | /** | ||
6 | * Exception interface for invalid cache arguments. | ||
7 | * | ||
8 | * Any time an invalid argument is passed into a method it must throw an | ||
9 | * exception class which implements Psr\Cache\InvalidArgumentException. | ||
10 | */ | ||
11 | interface InvalidArgumentException extends CacheException | ||
12 | { | ||
13 | } | ||