| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class AnnotationMetadataBuilder |
||
| 15 | { |
||
| 16 | /** @var string */ |
||
| 17 | private $name; |
||
| 18 | |||
| 19 | /** @var AnnotationTarget */ |
||
| 20 | private $target; |
||
| 21 | |||
| 22 | /** @var PropertyMetadata[] */ |
||
| 23 | private $properties = []; |
||
| 24 | |||
| 25 | /** @var bool */ |
||
| 26 | private $usesConstructor = false; |
||
| 27 | |||
| 28 | 261 | public function __construct(string $name) |
|
| 32 | 261 | } |
|
| 33 | |||
| 34 | 204 | public function withTarget(AnnotationTarget $target) : self |
|
| 35 | { |
||
| 36 | 204 | $this->target = $target; |
|
| 37 | |||
| 38 | 204 | return $this; |
|
| 39 | } |
||
| 40 | |||
| 41 | 90 | public function withUsingConstructor() : self |
|
| 42 | { |
||
| 43 | 90 | $this->usesConstructor = true; |
|
| 44 | |||
| 45 | 90 | return $this; |
|
| 46 | } |
||
| 47 | |||
| 48 | 236 | public function withProperty(PropertyMetadata $property) : self |
|
| 49 | { |
||
| 50 | 236 | $this->properties[] = $property; |
|
| 51 | |||
| 52 | 236 | return $this; |
|
| 53 | } |
||
| 54 | |||
| 55 | 253 | public function build() : AnnotationMetadata |
|
| 62 | ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |