Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | class CallableEntry implements EntryInterface |
||
15 | { |
||
16 | /** @var callable The callable used to determine the value for the entry */ |
||
17 | private $callable; |
||
18 | |||
19 | /** |
||
20 | * CallableEntry constructor. |
||
21 | * @param callable $callable The callable used to determine the value for the entry |
||
22 | */ |
||
23 | 3 | public function __construct(callable $callable) |
|
26 | 3 | } |
|
27 | |||
28 | /** {@inheritdoc} */ |
||
29 | 2 | public static function createFromCacheParameters(array $parameters): EntryInterface |
|
30 | { |
||
31 | /** @var CallableEntry $entry */ |
||
32 | 2 | $entry = (new \ReflectionClass(static::class))->newInstanceWithoutConstructor(); |
|
33 | 2 | $entry->callable = $parameters[0]; |
|
34 | |||
35 | 2 | return $entry; |
|
36 | } |
||
37 | |||
38 | /** {@inheritdoc} */ |
||
39 | 2 | public function getCacheParameters(): array |
|
42 | } |
||
43 | |||
44 | /** {@inheritdoc} */ |
||
45 | 3 | public function isFactory(): bool |
|
46 | { |
||
47 | 3 | return false; |
|
48 | } |
||
49 | |||
50 | /** {@inheritdoc} */ |
||
51 | 3 | public function getValue(ContainerInterface $container) |
|
54 | } |
||
55 | } |
||
56 |