Completed
Push — master ( af288c...9fe740 )
by Matthieu
06:20 queued 04:14
created

Injectable::__construct()   A

Complexity

Conditions 2
Paths 2

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 6
Code Lines 3

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace DI\Annotation;
4
5
/**
6
 * "Injectable" annotation.
7
 *
8
 * Marks a class as injectable
9
 *
10
 * @Annotation
11
 * @Target("CLASS")
12
 *
13
 * @author Domenic Muskulus <domenic@muskulus.eu>
14
 * @author Matthieu Napoli <matthieu@mnapoli.fr>
15
 */
16
final class Injectable
17
{
18
    /**
19
     * Should the object be lazy-loaded.
20
     * @var bool|null
21
     */
22
    private $lazy;
23
24
    public function __construct(array $values)
25
    {
26
        if (isset($values['lazy'])) {
27
            $this->lazy = (bool) $values['lazy'];
28
        }
29
    }
30
31
    /**
32
     * @return bool|null
33
     */
34
    public function isLazy()
35
    {
36
        return $this->lazy;
37
    }
38
}
39