ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
VoidContainer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Cache\Container;
22 
27 
31 final class VoidContainer implements Container
32 {
33  public function __construct(
34  private Request $request
35  ) {
36  }
37 
38  public function lock(float $seconds): void
39  {
40  }
41 
42  public function isLocked(): bool
43  {
44  return true;
45  }
46 
47  public function has(string $key): bool
48  {
49  return false;
50  }
51 
52  public function get(string $key, Transformation $transformation): string|int|array|bool|null
53  {
54  return null;
55  }
56 
57  public function set(string $key, array|bool|int|string|null $value, ?int $ttl = null): void
58  {
59  // nothing to do
60  }
61 
62  public function delete(string $key): void
63  {
64  // nothing to do
65  }
66 
67  public function flush(): void
68  {
69  // nothing to do
70  }
71 
72  public function getAdaptorName(): string
73  {
74  return 'null';
75  }
76 
77  public function getContainerName(): string
78  {
79  return $this->request->getContainerName();
80  }
81 }
getAdaptorName()
Returns the name of the adaptop used (such as apc, memcache, phpstatic)
__construct(private Request $request)
has(string $key)
Returns true if the container contains a value for the given key.
flush()
Deletes all values in the container.
string $key
Consumer key/client ID value.
Definition: System.php:193
A transformation is a function from one datatype to another.
isLocked()
Returns true if the container is locked.
getContainerName()
Returns the name of the container.
lock(float $seconds)
Locks the container for a given amount of seconds (max 300), in this time, get() will return null and...