| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 16 | public static function build(Immutable\Str $schema, Properties $properties): Property |
|
| 27 | { |
||
| 28 | 16 | if (!$schema->matches(self::PATTERN)) { |
|
| 29 | 3 | throw new SchemaNotParseable((string) $schema); |
|
| 30 | } |
||
| 31 | |||
| 32 | 13 | $self = new self( |
|
| 33 | 13 | (string) $schema->capture(self::PATTERN)->get('type') |
|
| 34 | ); |
||
| 35 | |||
| 36 | 13 | if ((string) $schema->substring(-1) === '+') { |
|
| 37 | 6 | $self->requiresValue = true; |
|
| 38 | } |
||
| 39 | |||
| 40 | 13 | return $self; |
|
| 41 | } |
||
| 75 |