| @@ 49-58 (lines=10) @@ | ||
| 46 | throw new EmptyArrayException($context); |
|
| 47 | } |
|
| 48 | ||
| 49 | foreach ($schema->{$keyword} as $index => $subSchema) { |
|
| 50 | $context->enterNode($subSchema, $index); |
|
| 51 | ||
| 52 | if (!is_object($subSchema)) { |
|
| 53 | throw new InvalidTypeException($context, Types::TYPE_OBJECT); |
|
| 54 | } |
|
| 55 | ||
| 56 | $walker->parseSchema($subSchema, $context); |
|
| 57 | $context->leaveNode(); |
|
| 58 | } |
|
| 59 | ||
| 60 | $context->leaveNode(); |
|
| 61 | } |
|
| @@ 110-119 (lines=10) @@ | ||
| 107 | if (is_object($schema->items)) { |
|
| 108 | $walker->parseSchema($schema->items, $context); |
|
| 109 | } elseif (is_array($schema->items)) { |
|
| 110 | foreach ($schema->items as $index => $item) { |
|
| 111 | $context->enterNode($schema->items[$index], $index); |
|
| 112 | ||
| 113 | if (!is_object($item)) { |
|
| 114 | throw new InvalidTypeException($context, Types::TYPE_OBJECT); |
|
| 115 | } |
|
| 116 | ||
| 117 | $walker->parseSchema($item, $context); |
|
| 118 | $context->leaveNode(); |
|
| 119 | } |
|
| 120 | } else { |
|
| 121 | throw new InvalidTypeException($context, [Types::TYPE_OBJECT, Types::TYPE_ARRAY]); |
|
| 122 | } |
|
| @@ 121-130 (lines=10) @@ | ||
| 118 | throw new InvalidTypeException($context, Types::TYPE_OBJECT); |
|
| 119 | } |
|
| 120 | ||
| 121 | foreach ($schema->properties as $property => $value) { |
|
| 122 | $context->enterNode($schema->properties->{$property}, $property); |
|
| 123 | ||
| 124 | if (!is_object($value)) { |
|
| 125 | throw new InvalidTypeException($context, Types::TYPE_OBJECT); |
|
| 126 | } |
|
| 127 | ||
| 128 | $walker->parseSchema($value, $context); |
|
| 129 | $context->leaveNode(); |
|
| 130 | } |
|
| 131 | } |
|
| 132 | ||
| 133 | private function parseAdditionalPropertiesProperty(stdClass $schema, Context $context, Walker $walker) |
|