Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
45 | 15 | public function normalize(stdClass $schema, Context $context, Walker $walker) |
|
46 | { |
||
47 | 15 | $context->enterNode('pattern'); |
|
48 | |||
49 | 15 | if (!is_string($schema->pattern)) { |
|
50 | 1 | throw new InvalidTypeException($context, Types::TYPE_STRING); |
|
51 | } |
||
52 | |||
53 | 14 | if (!Utils::isValidRegex($schema->pattern)) { |
|
54 | 1 | throw new InvalidRegexException($context); |
|
55 | } |
||
56 | |||
57 | 13 | $context->leaveNode(); |
|
58 | 13 | } |
|
59 | |||
70 |