Skip to content

Commit 192091d

Browse files
Move property accessor phpdoc to interface
1 parent 5499151 commit 192091d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

PropertyAccessor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ public function getValue(object|array $objectOrArray, string|PropertyPathInterfa
109109
return $propertyValues[\count($propertyValues) - 1][self::VALUE];
110110
}
111111

112-
/**
113-
* @template T of object|array
114-
* @param T $objectOrArray
115-
* @param-out ($objectOrArray is array ? array : T) $objectOrArray
116-
*/
117112
public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value): void
118113
{
119114
if (\is_object($objectOrArray) && (false === strpbrk((string) $propertyPath, '.[') || $objectOrArray instanceof \stdClass && property_exists($objectOrArray, $propertyPath))) {

PropertyAccessorInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ interface PropertyAccessorInterface
3939
*
4040
* If neither is found, an exception is thrown.
4141
*
42+
* @template T of object|array
43+
*
44+
* @param T $objectOrArray
45+
*
46+
* @param-out ($objectOrArray is array ? array : T) $objectOrArray
47+
*
4248
* @throws Exception\InvalidArgumentException If the property path is invalid
4349
* @throws Exception\AccessException If a property/index does not exist or is not public
4450
* @throws Exception\UnexpectedTypeException If a value within the path is neither object nor array

0 commit comments

Comments
 (0)