From 24bb5fefbdf93ce0969b7f56cc46c459ebb82a95 Mon Sep 17 00:00:00 2001 From: EoleDev Date: Thu, 14 Apr 2016 16:24:44 +0200 Subject: Mise a jour et nettoyage depot --- .../src/JsonSchema/Constraints/EnumConstraint.php | 46 ---------------------- 1 file changed, 46 deletions(-) delete mode 100644 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php (limited to 'server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php') diff --git a/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php b/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php deleted file mode 100644 index df413e4..0000000 --- a/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @author Bruno Prieto Reis - */ -class EnumConstraint extends Constraint -{ - /** - * {@inheritDoc} - */ - public function check($element, $schema = null, $path = null, $i = null) - { - // Only validate enum if the attribute exists - if ($element instanceof UndefinedConstraint && (!isset($schema->required) || !$schema->required)) { - return; - } - - foreach ($schema->enum as $enum) { - $type = gettype($element); - if ($type === gettype($enum)) { - if ($type == "object") { - if ($element == $enum) - return; - } else { - if ($element === $enum) - return; - - } - } - } - - $this->addError($path, "Does not have a value in the enumeration " . print_r($schema->enum, true), 'enum', array('enum' => $schema->enum,)); - } -} -- cgit v1.2.3