| Total Complexity | 5 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| 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 | public function __construct(string $name) |
||
| 29 | { |
||
| 30 | $this->name = $name; |
||
| 31 | $this->target = AnnotationTarget::all(); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function withTarget(AnnotationTarget $target) : self |
||
| 35 | { |
||
| 36 | $this->target = $target; |
||
| 37 | |||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function withUsingConstructor() : self |
||
| 42 | { |
||
| 43 | $this->usesConstructor = true; |
||
| 44 | |||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function withProperty(PropertyMetadata $property) : self |
||
| 49 | { |
||
| 50 | $this->properties[] = $property; |
||
| 51 | |||
| 52 | return $this; |
||
| 53 | } |
||
| 54 | |||
| 55 | public function build() : AnnotationMetadata |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |