|
@@ 23-31 (lines=9) @@
|
| 20 |
|
public function validateArray($data, $schema, $path) |
| 21 |
|
{ |
| 22 |
|
// check for minItems property |
| 23 |
|
if (isset($schema->minItems) && (count($data) < $schema->minItems)) { |
| 24 |
|
|
| 25 |
|
$count = count($data); |
| 26 |
|
|
| 27 |
|
$this->addError( |
| 28 |
|
ValidateException::ERROR_USER_ARRAY_MINIMUM_CHECK, |
| 29 |
|
[$path, $schema->minItems, $this->conjugationObject($schema->minItems), $this->conjugationToBe($count), $count, $this->conjugationObject($count)] |
| 30 |
|
); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
// check for maxItems property |
| 34 |
|
if (isset($schema->maxItems) && (count($data) > $schema->maxItems)) { |
|
@@ 34-42 (lines=9) @@
|
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
// check for maxItems property |
| 34 |
|
if (isset($schema->maxItems) && (count($data) > $schema->maxItems)) { |
| 35 |
|
|
| 36 |
|
$count = count($data); |
| 37 |
|
|
| 38 |
|
$this->addError( |
| 39 |
|
ValidateException::ERROR_USER_ARRAY_MAXIMUM_CHECK, |
| 40 |
|
[$path, $schema->maxItems, $this->conjugationToBe($count), $count, $this->conjugationObject($count)] |
| 41 |
|
); |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
// check for uniqueItems property |
| 45 |
|
if (isset($schema->uniqueItems) && $schema->uniqueItems && ($count = count($data))) { |