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