diff --git a/src/JsonSchema/JsonSchemaUndefined.php b/src/JsonSchema/Undefined.php similarity index 50% rename from src/JsonSchema/JsonSchemaUndefined.php rename to src/JsonSchema/Undefined.php index 0f4b2dc..876f966 100644 --- a/src/JsonSchema/JsonSchemaUndefined.php +++ b/src/JsonSchema/Undefined.php @@ -2,4 +2,6 @@ namespace JsonSchema; -class JsonSchemaUndefined {} +class Undefined +{ +} diff --git a/src/JsonSchema/Validator.php b/src/JsonSchema/Validator.php index fb6089d..7676c82 100644 --- a/src/JsonSchema/Validator.php +++ b/src/JsonSchema/Validator.php @@ -112,7 +112,7 @@ class Validator { // treat when we have more schema definitions than values for($k = count($value); $k < count($schema->items); $k++) { $this->checkProp( - new JsonSchemaUndefined(), + new Undefined(), $schema->items[$k], $path, $k, $_changing ); } @@ -160,7 +160,7 @@ class Validator { $this->checkProp($value,$schema->extends,$path,$i,$_changing); } // verify optional values - if (is_object($value) && $value instanceOf JsonSchemaUndefined) { + if (is_object($value) && $value instanceOf Undefined) { if ( isset($schema->optional) ? !$schema->optional : true) { $this->adderror($path,"is missing and it is not optional"); } @@ -370,7 +370,7 @@ class Validator { $value = array_key_exists($i,$instance) ? (is_array($instance) ? $instance[$i] : $instance->$i) : - new JsonSchemaUndefined(); + new Undefined(); $propDef = $objTypeDef->$i; $this->checkProp($value,$propDef,$path,$i,$_changing); } @@ -412,4 +412,3 @@ class Validator { return $this->errors; } } -