Skip to content

Commit 1607085

Browse files
committed
Fix linter issues
1 parent 34f93eb commit 1607085

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

src/Exception/Runtime/InvalidIterableKeyException.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ public static function createFromPath(
4242
}
4343

4444
/**
45+
* @param int<0, max> $index
46+
*
4547
* @return self<iterable<array-key, mixed>>
4648
*/
4749
public static function createFromContext(
@@ -50,11 +52,13 @@ public static function createFromContext(
5052
Context $context,
5153
?\Throwable $previous = null,
5254
): self {
53-
/** @var self<iterable<array-key, mixed>> */
55+
/** @var iterable<array-key, mixed> $value */
56+
$value = $context->value;
57+
5458
return self::createFromPath(
5559
index: $index,
5660
key: $key,
57-
value: $context->value,
61+
value: $value,
5862
path: $context->getPath(),
5963
previous: $previous,
6064
);

src/Exception/Runtime/InvalidIterableValueException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public static function createFromPath(
5050
}
5151

5252
/**
53+
* @param int<0, max> $index
5354
* @return self<iterable<array-key, mixed>>
5455
*/
5556
public static function createFromContext(
@@ -59,12 +60,14 @@ public static function createFromContext(
5960
Context $context,
6061
?\Throwable $previous = null,
6162
): self {
62-
/** @var self<iterable<array-key, mixed>> */
63+
/** @var iterable<array-key, mixed> $value */
64+
$value = $context->value;
65+
6366
return self::createFromPath(
6467
element: $element,
6568
index: $index,
6669
key: $key,
67-
value: $context->value,
70+
value: $value,
6871
path: $context->getPath(),
6972
previous: $previous,
7073
);

src/Exception/Runtime/InvalidObjectValueException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static function createFromPath(
4545
}
4646

4747
/**
48+
* @param non-empty-string $field
4849
* @return self<array<array-key, mixed>|object>
4950
*/
5051
public static function createFromContext(
@@ -54,12 +55,14 @@ public static function createFromContext(
5455
Context $context,
5556
?\Throwable $previous = null,
5657
): self {
57-
/** @var self<array<array-key, mixed>|object> */
58+
/** @var array<array-key, mixed>|object $value */
59+
$value = $context->value;
60+
5861
return self::createFromPath(
5962
element: $element,
6063
field: $field,
6164
expected: $expected,
62-
value: $context->value,
65+
value: $value,
6366
path: $context->getPath(),
6467
previous: $previous,
6568
);

src/Exception/Runtime/MissingRequiredObjectFieldException.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static function createFromPath(
4343
}
4444

4545
/**
46+
* @param non-empty-string $field
4647
* @return self<array<array-key, mixed>|object>
4748
*/
4849
public static function createFromContext(
@@ -51,11 +52,13 @@ public static function createFromContext(
5152
Context $context,
5253
?\Throwable $previous = null,
5354
): self {
54-
/** @var self<array<array-key, mixed>|object> */
55+
/** @var array<array-key, mixed>|object $value */
56+
$value = $context->value;
57+
5558
return self::createFromPath(
5659
field: $field,
5760
expected: $expected,
58-
value: $context->value,
61+
value: $value,
5962
path: $context->getPath(),
6063
previous: $previous,
6164
);

0 commit comments

Comments
 (0)