Skip to content

Commit 19d9f95

Browse files
committed
* else if -> elseif
* cleanup
1 parent 94d7bc5 commit 19d9f95

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

src/Draft/AbstractDraft.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function dereferenceJsonPointer(object $schema, string $fragment): mixed
311311
}
312312

313313
$currentSchemaPart = &$currentSchemaPart[$token];
314-
} else if (is_object($currentSchemaPart)) {
314+
} elseif (is_object($currentSchemaPart)) {
315315
if (!isset($currentSchemaPart->{$token})) {
316316
return null;
317317
}
@@ -392,7 +392,7 @@ public function valuesAreEqual(mixed $value1, mixed $value2): bool
392392
if (!array_key_exists($key, $value1)) {
393393
return false;
394394
}
395-
} else if (!property_exists($value1, $key)) {
395+
} elseif (!property_exists($value1, $key)) {
396396
return false;
397397
}
398398
}

src/Keyword/Applicator/ContainsKeyword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function evaluate(mixed $keywordValue, RuntimeEvaluationContext $context)
6666

6767
if ($matchedIndexes) {
6868
ksort($matchedIndexes);
69-
} else if (!isset($currentSchema->minContains) || $currentSchema->minContains > 0) {
69+
} elseif (!isset($currentSchema->minContains) || $currentSchema->minContains > 0) {
7070
$result->invalidate('No item matches schema');
7171
return $result;
7272
}

src/Keyword/UnknownKeyword.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ public function __construct(int $priority, string $name)
1616
$this->name = $name;
1717
}
1818

19-
/*public function evaluateStatic(mixed &$keywordValue, StaticEvaluationContext $context): void
20-
{
21-
if (is_object($keywordValue)) {
22-
$this->evaluateStaticObject($keywordValue, $context);
23-
} else if (is_array($keywordValue)) {
24-
$this->evaluateStaticArray($keywordValue, $context);
25-
}
26-
}*/
27-
2819
public function evaluate(mixed $keywordValue, RuntimeEvaluationContext $context): ?RuntimeEvaluationResult
2920
{
3021
$result = $context->createResultForKeyword($this);
@@ -37,24 +28,4 @@ public function getName(): string
3728
{
3829
return $this->name;
3930
}
40-
41-
/*
42-
protected function evaluateStaticObject(object &$keywordValue, $context): void
43-
{
44-
$context->pushSchema($keywordValue);
45-
$context->draft->evaluateStatic($context);
46-
$context->popSchema();
47-
}
48-
49-
protected function evaluateStaticArray(array &$keywordValue, $context): void
50-
{
51-
foreach ($keywordValue as &$item) {
52-
if (is_object($item)) {
53-
$this->evaluateStaticObject($item, $context);
54-
} else if (is_array($item)) {
55-
$this->evaluateStaticArray($keywordValue, $context);
56-
}
57-
}
58-
}
59-
*/
6031
}

src/Keyword/Validation/FormatKeyword.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ protected function checkRfc3339Time(string $rfcTime): bool
375375
// Invalid leap second
376376
return false;
377377
}
378-
} else if ($offset) {
378+
} elseif ($offset) {
379379
$offsetParts = explode(':', $parts[1], 2);
380380
if (count($offsetParts) !== 2) {
381381
return false;
@@ -553,11 +553,11 @@ protected function checkUri(string $uri, bool $absolute, bool $international = f
553553
if (!$this->checkEmail(substr($uri, 7))) {
554554
return false;
555555
}
556-
} else if ($scheme === 'tel') {
556+
} elseif ($scheme === 'tel') {
557557
if (!$this->checkPhone(substr($uri, 4))) {
558558
return false;
559559
}
560-
} else if ($scheme === 'urn') {
560+
} elseif ($scheme === 'urn') {
561561
if (!$this->checkUrn($uri)) {
562562
return false;
563563
}

0 commit comments

Comments
 (0)