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