Skip to content

Commit 3650f34

Browse files
committed
* Removed unnecessary InvalidSchemaException
* Moved compliance tests to compliance namespace * Added unit tests for code which is not covered by compliance test
1 parent ec4a37d commit 3650f34

File tree

50 files changed

+322
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+322
-112
lines changed

src/Draft/AbstractDraft.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Ropi\JsonSchemaEvaluator\Draft\Exception\UnsupportedVocabularyException;
1111
use Ropi\JsonSchemaEvaluator\EvaluationContext\RuntimeEvaluationContext;
1212
use Ropi\JsonSchemaEvaluator\EvaluationContext\StaticEvaluationContext;
13-
use Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException;
1413
use Ropi\JsonSchemaEvaluator\Keyword\KeywordInterface;
1514
use Ropi\JsonSchemaEvaluator\Keyword\MutationKeywordInterface;
1615
use Ropi\JsonSchemaEvaluator\Keyword\RuntimeKeywordInterface;
@@ -180,7 +179,6 @@ public function schemaHasMutationKeywords(\stdClass|bool $schema): bool
180179
}
181180

182181
/**
183-
* @throws InvalidSchemaException
184182
* @throws \Ropi\JsonSchemaEvaluator\Keyword\Exception\StaticKeywordAnalysisException
185183
*/
186184
public function evaluateStatic(StaticEvaluationContext $context): void
@@ -191,13 +189,6 @@ public function evaluateStatic(StaticEvaluationContext $context): void
191189
return;
192190
}
193191

194-
if (!$schema instanceof \stdClass) {
195-
throw new InvalidSchemaException(
196-
'JSON Schema must be an object or a boolean',
197-
$context
198-
);
199-
}
200-
201192
if (!$context->hasPrioritizedSchemaKeywords($schema)) {
202193
$context->registerPrioritizedSchemaKeywords(
203194
$schema,

src/Draft/DraftInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Ropi\JsonSchemaEvaluator\Draft\Exception\UnsupportedVocabularyException;
88
use Ropi\JsonSchemaEvaluator\EvaluationContext\RuntimeEvaluationContext;
99
use Ropi\JsonSchemaEvaluator\EvaluationContext\StaticEvaluationContext;
10-
use Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException;
1110
use Ropi\JsonSchemaEvaluator\Keyword\KeywordInterface;
1211
use Ropi\JsonSchemaEvaluator\Type\NumberInterface;
1312

@@ -51,7 +50,6 @@ function shortCircuit(): bool;
5150
function acceptNumericStrings(): bool;
5251

5352
/**
54-
* @throws InvalidSchemaException
5553
* @throws \Ropi\JsonSchemaEvaluator\Keyword\Exception\StaticKeywordAnalysisException
5654
*/
5755
function evaluateStatic(StaticEvaluationContext $context): void;

src/Draft/Exception/InvalidSchemaException.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/JsonSchemaEvaluator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
class JsonSchemaEvaluator implements JsonSchemaEvaluatorInterface
1212
{
1313
/**
14-
* @throws Draft\Exception\InvalidSchemaException
1514
* @throws Keyword\Exception\StaticKeywordAnalysisException
1615
*/
1716
public function evaluateStatic(\stdClass|bool $jsonSchema, StaticEvaluationConfig $config): StaticEvaluationContext

src/JsonSchemaEvaluatorInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
interface JsonSchemaEvaluatorInterface
1111
{
1212
/**
13-
* @throws Draft\Exception\InvalidSchemaException
1413
* @throws Keyword\Exception\StaticKeywordAnalysisException
1514
*/
1615
function evaluateStatic(\stdClass $jsonSchema, StaticEvaluationConfig $config): StaticEvaluationContext;

src/Keyword/Applicator/AdditionalPropertiesKeyword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function getName(): string
2121

2222
/**
2323
* @throws StaticKeywordAnalysisException
24-
* @throws \Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException
2524
* @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection
2625
*/
2726
public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void

src/Keyword/Applicator/AllOfKeyword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public function getName(): string
2222

2323
/**
2424
* @throws StaticKeywordAnalysisException
25-
* @throws \Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException
2625
* @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection
2726
*/
2827
public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void

src/Keyword/Applicator/AnyOfKeyword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public function getName(): string
2222

2323
/**
2424
* @throws StaticKeywordAnalysisException
25-
* @throws \Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException
2625
* @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection
2726
*/
2827
public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void

src/Keyword/Applicator/ContainsKeyword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function getName(): string
2121

2222
/**
2323
* @throws StaticKeywordAnalysisException
24-
* @throws \Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException
2524
* @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection
2625
*/
2726
public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void

src/Keyword/Applicator/DependentSchemasKeyword.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function getName(): string
2121

2222
/**
2323
* @throws StaticKeywordAnalysisException
24-
* @throws \Ropi\JsonSchemaEvaluator\Draft\Exception\InvalidSchemaException
2524
* @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection
2625
*/
2726
public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void

0 commit comments

Comments
 (0)