Skip to content

Commit f8f01de

Browse files
authored
Add types to PurgatoryPropertyAccessor (#132)
1 parent d8a2471 commit f8f01de

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/RouteProvider/PropertyAccess/PurgatoryPropertyAccessor.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ public function __construct(
2424

2525
/**
2626
* @param object|array<array-key, mixed> $objectOrArray
27-
* @param string|PropertyPathInterface $propertyPath
2827
*/
29-
public function getValue($objectOrArray, $propertyPath): mixed
28+
public function getValue(object|array $objectOrArray, string|PropertyPathInterface $propertyPath): mixed
3029
{
3130
if (!str_contains((string) $propertyPath, self::DELIMITER)) {
3231
return $this->propertyAccessor->getValue($objectOrArray, $propertyPath);
@@ -59,29 +58,26 @@ public function getValue($objectOrArray, $propertyPath): mixed
5958

6059
/**
6160
* @param object|array<array-key, mixed> $objectOrArray
62-
* @param string|PropertyPathInterface $propertyPath
6361
*
6462
* @param-out object|array<array-key, mixed> $objectOrArray
6563
*/
66-
public function setValue(&$objectOrArray, $propertyPath, mixed $value): void
64+
public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value): void
6765
{
6866
$this->propertyAccessor->setValue($objectOrArray, $propertyPath, $value);
6967
}
7068

7169
/**
7270
* @param object|array<array-key, mixed> $objectOrArray
73-
* @param string|PropertyPathInterface $propertyPath
7471
*/
75-
public function isWritable($objectOrArray, $propertyPath): bool
72+
public function isWritable(object|array $objectOrArray, string|PropertyPathInterface $propertyPath): bool
7673
{
7774
return $this->propertyAccessor->isWritable($objectOrArray, $propertyPath);
7875
}
7976

8077
/**
8178
* @param object|array<array-key, mixed> $objectOrArray
82-
* @param string|PropertyPathInterface $propertyPath
8379
*/
84-
public function isReadable($objectOrArray, $propertyPath): bool
80+
public function isReadable(object|array $objectOrArray, string|PropertyPathInterface $propertyPath): bool
8581
{
8682
if (!str_contains((string) $propertyPath, self::DELIMITER)) {
8783
return $this->propertyAccessor->isReadable($objectOrArray, $propertyPath);

0 commit comments

Comments
 (0)