summaryrefslogtreecommitdiff
path: root/server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php
diff options
context:
space:
mode:
authorEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
committerEoleDev <EoleDev@outlook.fr>2016-04-14 16:28:25 +0200
commit31d2d0c158ad4daa3dde7a905f3c2e312c194f2e (patch)
tree43d761d2aec8265a22c0fdedcc365bacc10dc814 /server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php
parent27730911d8c9253a4f5aa90450c57cdeca9d5d26 (diff)
parentb348dbc2266a3e8070a3951fb0bd8c19b852ec47 (diff)
Merge branch 'compute'
Conflicts: server/core/LibOverride/genTokenOptions.php
Diffstat (limited to 'server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php')
-rwxr-xr-xserver/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php54
1 files changed, 0 insertions, 54 deletions
diff --git a/server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php b/server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php
deleted file mode 100755
index 7652c42..0000000
--- a/server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-namespace JsonSchema\Uri\Retrievers;
-
-use JsonSchema\Validator;
-
-/**
- * URI retrieved based on a predefined array of schemas
- *
- * @example
- *
- * $retriever = new PredefinedArray(array(
- * 'http://acme.com/schemas/person#' => '{ ... }',
- * 'http://acme.com/schemas/address#' => '{ ... }',
- * ))
- *
- * $schema = $retriever->retrieve('http://acme.com/schemas/person#');
- */
-class PredefinedArray extends AbstractRetriever
-{
- /**
- * Contains schemas as URI => JSON
- * @var array
- */
- private $schemas;
-
- /**
- * Constructor
- *
- * @param array $schemas
- * @param string $contentType
- */
- public function __construct(array $schemas, $contentType = Validator::SCHEMA_MEDIA_TYPE)
- {
- $this->schemas = $schemas;
- $this->contentType = $contentType;
- }
-
- /**
- * {@inheritDoc}
- * @see \JsonSchema\Uri\Retrievers\UriRetrieverInterface::retrieve()
- */
- public function retrieve($uri)
- {
- if (!array_key_exists($uri, $this->schemas)) {
- throw new \JsonSchema\Exception\ResourceNotFoundException(sprintf(
- 'The JSON schema "%s" was not found.',
- $uri
- ));
- }
-
- return $this->schemas[$uri];
- }
-}