diff --git a/PropertyAccessor.php b/PropertyAccessor.php index d34e19f..7066e15 100644 --- a/PropertyAccessor.php +++ b/PropertyAccessor.php @@ -109,11 +109,6 @@ public function getValue(object|array $objectOrArray, string|PropertyPathInterfa return $propertyValues[\count($propertyValues) - 1][self::VALUE]; } - /** - * @template T of object|array - * @param T $objectOrArray - * @param-out ($objectOrArray is array ? array : T) $objectOrArray - */ public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value): void { if (\is_object($objectOrArray) && (false === strpbrk((string) $propertyPath, '.[') || $objectOrArray instanceof \stdClass && property_exists($objectOrArray, $propertyPath))) { diff --git a/PropertyAccessorBuilder.php b/PropertyAccessorBuilder.php index c860485..30e3ab8 100644 --- a/PropertyAccessorBuilder.php +++ b/PropertyAccessorBuilder.php @@ -128,7 +128,7 @@ public function disableMagicSet(): static */ public function isMagicCallEnabled(): bool { - return (bool) ($this->magicMethods & PropertyAccessor::MAGIC_CALL); + return $this->magicMethods & PropertyAccessor::MAGIC_CALL; } /** diff --git a/PropertyAccessorInterface.php b/PropertyAccessorInterface.php index 2e25e9e..ccbaf8b 100644 --- a/PropertyAccessorInterface.php +++ b/PropertyAccessorInterface.php @@ -39,6 +39,12 @@ interface PropertyAccessorInterface * * If neither is found, an exception is thrown. * + * @template T of object|array + * + * @param T $objectOrArray + * + * @param-out ($objectOrArray is array ? array : T) $objectOrArray + * * @throws Exception\InvalidArgumentException If the property path is invalid * @throws Exception\AccessException If a property/index does not exist or is not public * @throws Exception\UnexpectedTypeException If a value within the path is neither object nor array diff --git a/PropertyPath.php b/PropertyPath.php index e797ab7..71b90fc 100644 --- a/PropertyPath.php +++ b/PropertyPath.php @@ -72,7 +72,7 @@ public function __construct(self|string $propertyPath) { // Can be used as copy constructor if ($propertyPath instanceof self) { - /* @var PropertyPath $propertyPath */ + /** @var PropertyPath $propertyPath */ $this->elements = $propertyPath->elements; $this->length = $propertyPath->length; $this->isIndex = $propertyPath->isIndex;