diff --git a/src/JsonSchema/Constraints/Factory.php b/src/JsonSchema/Constraints/Factory.php index 5eadb17e..d67fc952 100644 --- a/src/JsonSchema/Constraints/Factory.php +++ b/src/JsonSchema/Constraints/Factory.php @@ -11,6 +11,7 @@ use JsonSchema\Exception\InvalidArgumentException; use JsonSchema\SchemaStorage; +use JsonSchema\SchemaStorageInterface; use JsonSchema\Uri\UriRetriever; use JsonSchema\UriRetrieverInterface; @@ -68,7 +69,7 @@ class Factory * @param int $checkMode */ public function __construct( - SchemaStorage $schemaStorage = null, + SchemaStorageInterface $schemaStorage = null, UriRetrieverInterface $uriRetriever = null, $checkMode = Constraint::CHECK_MODE_NORMAL ) { diff --git a/src/JsonSchema/SchemaStorage.php b/src/JsonSchema/SchemaStorage.php index ff4b67d5..03d28d10 100644 --- a/src/JsonSchema/SchemaStorage.php +++ b/src/JsonSchema/SchemaStorage.php @@ -8,7 +8,7 @@ use JsonSchema\Uri\UriResolver; use JsonSchema\Uri\UriRetriever; -class SchemaStorage +class SchemaStorage implements SchemaStorageInterface { protected $uriRetriever; protected $uriResolver; @@ -39,8 +39,7 @@ public function getUriResolver() } /** - * @param string $id - * @param object $schema + * {@inheritdoc} */ public function addSchema($id, $schema = null) { @@ -58,8 +57,7 @@ public function addSchema($id, $schema = null) } /** - * @param string $id - * @return object + * {@inheritdoc} */ public function getSchema($id) { @@ -70,6 +68,9 @@ public function getSchema($id) return $this->schemas[$id]; } + /** + * {@inheritdoc} + */ public function resolveRef($ref) { $jsonPointer = new JsonPointer($ref); @@ -93,8 +94,7 @@ public function resolveRef($ref) } /** - * @param $refSchema - * @return object + * {@inheritdoc} */ public function resolveRefSchema($refSchema) { diff --git a/src/JsonSchema/SchemaStorageInterface.php b/src/JsonSchema/SchemaStorageInterface.php new file mode 100644 index 00000000..0f67478b --- /dev/null +++ b/src/JsonSchema/SchemaStorageInterface.php @@ -0,0 +1,34 @@ +