From 5ac997b43ce2a87fb58bc8da002b3708ac1239cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Mon, 13 Jul 2015 19:05:04 -0400 Subject: [PATCH] Fix: Be more specific with error message --- src/JsonSchema/Constraints/CollectionConstraint.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JsonSchema/Constraints/CollectionConstraint.php b/src/JsonSchema/Constraints/CollectionConstraint.php index 7de3bc4d..89baafb0 100644 --- a/src/JsonSchema/Constraints/CollectionConstraint.php +++ b/src/JsonSchema/Constraints/CollectionConstraint.php @@ -24,12 +24,12 @@ public function check($value, $schema = null, $path = null, $i = null) { // Verify minItems if (isset($schema->minItems) && count($value) < $schema->minItems) { - $this->addError($path, "There must be a minimum of " . $schema->minItems . " in the array"); + $this->addError($path, "There must be a minimum of " . $schema->minItems . " items in the array"); } // Verify maxItems if (isset($schema->maxItems) && count($value) > $schema->maxItems) { - $this->addError($path, "There must be a maximum of " . $schema->maxItems . " in the array"); + $this->addError($path, "There must be a maximum of " . $schema->maxItems . " items in the array"); } // Verify uniqueItems @@ -109,4 +109,4 @@ protected function validateItems($value, $schema = null, $path = null, $i = null } } } -} \ No newline at end of file +}