| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 86 | public function normalize(stdClass $schema, Context $context, Walker $walker) |
|
| 29 | { |
||
| 30 | 86 | $keyword = $this->keywords()[0]; |
|
| 31 | 86 | $context->enterNode($keyword); |
|
| 32 | |||
| 33 | 86 | if (!is_int($schema->{$keyword})) { |
|
| 34 | 6 | throw new InvalidTypeException($context, Types::TYPE_INTEGER); |
|
| 35 | } |
||
| 36 | |||
| 37 | 80 | if ($schema->{$keyword} < 0) { |
|
| 38 | 6 | throw new LessThanZeroException($context); |
|
| 39 | } |
||
| 40 | |||
| 41 | 74 | $context->leaveNode(); |
|
| 42 | 74 | } |
|
| 43 | } |
||
| 44 |