diff options
| author | Eole <EoleDev@outlook.fr> | 2016-04-27 16:42:28 +0200 |
|---|---|---|
| committer | Eole <EoleDev@outlook.fr> | 2016-04-27 16:42:28 +0200 |
| commit | 49f416dc5061032e0514ea0cfeceaca37d13e432 (patch) | |
| tree | 1202ac2a6fa860b8929afdc886c94fc50bd0a1de /server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php | |
| parent | c7edd70b5e5b0f5159c78ce3d924d4e7f60db816 (diff) | |
| parent | c9202d9113210981ae47df40511645da2ee140df (diff) | |
Merge branch 'develop' into Eole_Graph
Conflicts:
client/index.html
client/js/controllers/home/home.js
client/partials/home/home.html
Diffstat (limited to 'server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php')
| -rw-r--r-- | server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php | 54 |
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 100644 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]; - } -} |
