Skip to content

Commit 70a03b4

Browse files
committed
Merge pull request #171 from localheinz/fix/items
Fix: Be more specific with error message
2 parents fafdbcd + 5ac997b commit 70a03b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/JsonSchema/Constraints/CollectionConstraint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function check($value, $schema = null, $path = null, $i = null)
2424
{
2525
// Verify minItems
2626
if (isset($schema->minItems) && count($value) < $schema->minItems) {
27-
$this->addError($path, "There must be a minimum of " . $schema->minItems . " in the array");
27+
$this->addError($path, "There must be a minimum of " . $schema->minItems . " items in the array");
2828
}
2929

3030
// Verify maxItems
3131
if (isset($schema->maxItems) && count($value) > $schema->maxItems) {
32-
$this->addError($path, "There must be a maximum of " . $schema->maxItems . " in the array");
32+
$this->addError($path, "There must be a maximum of " . $schema->maxItems . " items in the array");
3333
}
3434

3535
// Verify uniqueItems
@@ -109,4 +109,4 @@ protected function validateItems($value, $schema = null, $path = null, $i = null
109109
}
110110
}
111111
}
112-
}
112+
}

0 commit comments

Comments
 (0)