|
8 | 8 | class ClassDescriptionBuilder |
9 | 9 | { |
10 | 10 | /** @var list<ClassDependency> */ |
11 | | - private $classDependencies = []; |
| 11 | + private array $classDependencies = []; |
12 | 12 |
|
13 | | - /** @var ?FullyQualifiedClassName */ |
14 | | - private $FQCN; |
| 13 | + private ?FullyQualifiedClassName $FQCN = null; |
15 | 14 |
|
16 | 15 | /** @var list<FullyQualifiedClassName> */ |
17 | | - private $interfaces = []; |
| 16 | + private array $interfaces = []; |
18 | 17 |
|
19 | | - /** @var ?FullyQualifiedClassName */ |
20 | | - private $extend; |
| 18 | + /** @var list<FullyQualifiedClassName> */ |
| 19 | + private array $extends = []; |
21 | 20 |
|
22 | | - /** @var bool */ |
23 | | - private $final = false; |
| 21 | + private bool $final = false; |
24 | 22 |
|
25 | | - /** @var bool */ |
26 | | - private $readonly = false; |
| 23 | + private bool $readonly = false; |
27 | 24 |
|
28 | | - /** @var bool */ |
29 | | - private $abstract = false; |
| 25 | + private bool $abstract = false; |
30 | 26 |
|
31 | 27 | /** @var list<string> */ |
32 | | - private $docBlock = []; |
| 28 | + private array $docBlock = []; |
33 | 29 |
|
34 | 30 | /** @var list<FullyQualifiedClassName> */ |
35 | | - private $attributes = []; |
| 31 | + private array $attributes = []; |
36 | 32 |
|
37 | | - /** @var bool */ |
38 | | - private $interface = false; |
| 33 | + private bool $interface = false; |
39 | 34 |
|
40 | | - /** @var bool */ |
41 | | - private $trait = false; |
| 35 | + private bool $trait = false; |
42 | 36 |
|
43 | | - /** @var bool */ |
44 | | - private $enum = false; |
| 37 | + private bool $enum = false; |
45 | 38 |
|
46 | 39 | public function clear(): void |
47 | 40 | { |
48 | 41 | $this->FQCN = null; |
49 | 42 | $this->classDependencies = []; |
50 | 43 | $this->interfaces = []; |
51 | | - $this->extend = null; |
| 44 | + $this->extends = []; |
52 | 45 | $this->final = false; |
53 | 46 | $this->readonly = false; |
54 | 47 | $this->abstract = false; |
@@ -81,10 +74,10 @@ public function addDependency(ClassDependency $cd): self |
81 | 74 | return $this; |
82 | 75 | } |
83 | 76 |
|
84 | | - public function setExtends(string $FQCN, int $line): self |
| 77 | + public function addExtends(string $FQCN, int $line): self |
85 | 78 | { |
86 | 79 | $this->addDependency(new ClassDependency($FQCN, $line)); |
87 | | - $this->extend = FullyQualifiedClassName::fromString($FQCN); |
| 80 | + $this->extends[] = FullyQualifiedClassName::fromString($FQCN); |
88 | 81 |
|
89 | 82 | return $this; |
90 | 83 | } |
@@ -154,7 +147,7 @@ public function build(): ClassDescription |
154 | 147 | $this->FQCN, |
155 | 148 | $this->classDependencies, |
156 | 149 | $this->interfaces, |
157 | | - $this->extend, |
| 150 | + $this->extends, |
158 | 151 | $this->final, |
159 | 152 | $this->readonly, |
160 | 153 | $this->abstract, |
|
0 commit comments