Total Complexity | 6 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | final class ScopeBuilder |
||
12 | { |
||
13 | /** @var \Reflector */ |
||
14 | private $subject; |
||
15 | |||
16 | /** @var Imports */ |
||
17 | private $imports; |
||
18 | |||
19 | /** @var IgnoredAnnotations */ |
||
20 | private $ignoredAnnotations; |
||
21 | |||
22 | /** @var int */ |
||
23 | private $nestingLevel; |
||
24 | |||
25 | public function __construct() |
||
26 | { |
||
27 | $this->subject = new \ReflectionClass(self::class); |
||
28 | $this->imports = new Imports([]); |
||
29 | $this->ignoredAnnotations = new IgnoredAnnotations(); |
||
30 | $this->nestingLevel = 0; |
||
31 | } |
||
32 | |||
33 | public function withSubject(\Reflector $reflector): self |
||
34 | { |
||
35 | $this->subject = $reflector; |
||
36 | |||
37 | return $this; |
||
38 | } |
||
39 | |||
40 | public function withImports(array $map): self |
||
41 | { |
||
42 | $this->imports = new Imports($map); |
||
43 | |||
44 | return $this; |
||
45 | } |
||
46 | |||
47 | public function withIgnoredAnnotations(array $names): self |
||
48 | { |
||
49 | $this->ignoredAnnotations = new IgnoredAnnotations(...$names); |
||
50 | |||
51 | return $this; |
||
52 | } |
||
53 | |||
54 | public function withNestingLevel(int $level): self |
||
59 | } |
||
60 | |||
61 | public function build(): Scope |
||
68 | ); |
||
69 | } |
||
70 | } |
||
71 |