summaryrefslogtreecommitdiff
path: root/vendor/symfony/cache/Adapter/Psr16Adapter.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-10-18 00:08:23 +0200
committerpolo <ordipolo@gmx.fr>2026-10-18 00:10:03 +0200
commit05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch)
treecf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/symfony/cache/Adapter/Psr16Adapter.php
parent32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff)
downloadAppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2
AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/symfony/cache/Adapter/Psr16Adapter.php')
-rw-r--r--vendor/symfony/cache/Adapter/Psr16Adapter.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/vendor/symfony/cache/Adapter/Psr16Adapter.php b/vendor/symfony/cache/Adapter/Psr16Adapter.php
deleted file mode 100644
index a72b037..0000000
--- a/vendor/symfony/cache/Adapter/Psr16Adapter.php
+++ /dev/null
@@ -1,71 +0,0 @@
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\Component\Cache\Adapter;
13
14use Psr\SimpleCache\CacheInterface;
15use Symfony\Component\Cache\PruneableInterface;
16use Symfony\Component\Cache\ResettableInterface;
17use Symfony\Component\Cache\Traits\ProxyTrait;
18
19/**
20 * Turns a PSR-16 cache into a PSR-6 one.
21 *
22 * @author Nicolas Grekas <p@tchwork.com>
23 */
24class Psr16Adapter extends AbstractAdapter implements PruneableInterface, ResettableInterface
25{
26 use ProxyTrait;
27
28 /**
29 * @internal
30 */
31 protected const NS_SEPARATOR = '_';
32
33 private object $miss;
34
35 public function __construct(CacheInterface $pool, string $namespace = '', int $defaultLifetime = 0)
36 {
37 parent::__construct($namespace, $defaultLifetime);
38
39 $this->pool = $pool;
40 $this->miss = new \stdClass();
41 }
42
43 protected function doFetch(array $ids): iterable
44 {
45 foreach ($this->pool->getMultiple($ids, $this->miss) as $key => $value) {
46 if ($this->miss !== $value) {
47 yield $key => $value;
48 }
49 }
50 }
51
52 protected function doHave(string $id): bool
53 {
54 return $this->pool->has($id);
55 }
56
57 protected function doClear(string $namespace): bool
58 {
59 return $this->pool->clear();
60 }
61
62 protected function doDelete(array $ids): bool
63 {
64 return $this->pool->deleteMultiple($ids);
65 }
66
67 protected function doSave(array $values, int $lifetime): array|bool
68 {
69 return $this->pool->setMultiple($values, 0 === $lifetime ? null : $lifetime);
70 }
71}