Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
14 | class FactoryEntry implements EntryInterface |
||
15 | { |
||
16 | /** @var EntryInterface The actual container entry used to determine the value */ |
||
17 | private $entry; |
||
18 | |||
19 | /** |
||
20 | * FactoryType constructor. |
||
21 | * @param EntryInterface $type The actual container entry used to determine the value |
||
22 | */ |
||
23 | 1 | public function __construct(EntryInterface $type) |
|
24 | { |
||
25 | 1 | $this->entry = $type; |
|
26 | 1 | } |
|
27 | |||
28 | /** {@inheritdoc} */ |
||
29 | 1 | public static function createFromCacheParameters(array $parameters): EntryInterface |
|
30 | { |
||
31 | /** @var EntryInterface $class */ |
||
32 | 1 | [$class, $cacheParameters] = $parameters; |
|
33 | |||
34 | 1 | return new static($class::createFromCacheParameters($cacheParameters)); |
|
35 | } |
||
36 | |||
37 | /** {@inheritdoc} */ |
||
38 | 1 | public function getCacheParameters(): array |
|
39 | { |
||
40 | return [ |
||
41 | 1 | \get_class($this->entry), |
|
42 | 1 | $this->entry->getCacheParameters(), |
|
43 | ]; |
||
44 | } |
||
45 | |||
46 | /** {@inheritdoc} */ |
||
47 | 1 | public function isFactory(): bool |
|
48 | { |
||
49 | 1 | return true; |
|
50 | } |
||
51 | |||
52 | /** {@inheritdoc} */ |
||
53 | 1 | public function getValue(ContainerInterface $container) |
|
56 | } |
||
57 | } |
||
58 |