| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | class LazyValue implements LazyInterface |
||
| 31 | { |
||
| 32 | /** |
||
| 33 | * The value key to retrieve. |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | protected $key; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * The Resolver that holds the values. |
||
| 41 | * |
||
| 42 | * @var Resolver |
||
| 43 | */ |
||
| 44 | protected $resolver; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Constructor. |
||
| 48 | * |
||
| 49 | * @param Resolver $resolver The Resolver that holds the values. |
||
| 50 | * @param string $key The value key to retrieve. |
||
| 51 | */ |
||
| 52 | 3 | public function __construct(Resolver $resolver, string $key) |
|
| 53 | { |
||
| 54 | 3 | $this->resolver = $resolver; |
|
| 55 | 3 | $this->key = $key; |
|
| 56 | 3 | } |
|
| 57 | |||
| 58 | /** |
||
| 59 | * |
||
| 60 | * Returns the lazy value. |
||
| 61 | * |
||
| 62 | * @return mixed |
||
| 63 | * |
||
| 64 | */ |
||
| 65 | 3 | public function __invoke() |
|
| 80 | } |
||
| 81 | } |
||
| 82 |