| Total Complexity | 12 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | final class Sequence implements Property |
||
| 15 | { |
||
| 16 | private const PATTERN = '~^sequence\+?$~'; |
||
| 17 | |||
| 18 | private $requiresValue = false; |
||
| 19 | |||
| 20 | 14 | private function __construct(bool $requiresValue) |
|
| 23 | 14 | } |
|
| 24 | |||
| 25 | 17 | public static function build(Immutable\Str $schema, Properties $properties): Property |
|
| 26 | { |
||
| 27 | 17 | if (!$schema->matches(self::PATTERN)) { |
|
| 28 | 3 | throw new SchemaNotParseable((string) $schema); |
|
| 29 | } |
||
| 30 | |||
| 31 | 14 | return new self((string) $schema->substring(-1) === '+'); |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | 11 | public function process($value) |
|
| 66 | } |
||
| 67 | } |
||
| 68 |