From a44cc1d2e3c0f147e91a5c052ac7fd879e34e706 Mon Sep 17 00:00:00 2001 From: Eole Date: Thu, 21 Jan 2016 10:29:26 +0100 Subject: Init Server Composer Components --- .../JsonSchema/Constraints/SchemaConstraint.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php (limited to 'server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php') diff --git a/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php b/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php new file mode 100644 index 0000000..b856a11 --- /dev/null +++ b/server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php @@ -0,0 +1,37 @@ + + * @author Bruno Prieto Reis + */ +class SchemaConstraint extends Constraint +{ + /** + * {@inheritDoc} + */ + public function check($element, $schema = null, $path = null, $i = null) + { + if ($schema !== null) { + // passed schema + $this->checkUndefined($element, $schema, '', ''); + } elseif (property_exists($element, $this->inlineSchemaProperty)) { + // inline schema + $this->checkUndefined($element, $element->{$this->inlineSchemaProperty}, '', ''); + } else { + throw new InvalidArgumentException('no schema found to verify against'); + } + } +} \ No newline at end of file -- cgit v1.2.3