From 5d301bdefaf4e29f25e9184c123d230658a7f29b Mon Sep 17 00:00:00 2001 From: Smoren Date: Fri, 15 Mar 2024 20:15:16 +0300 Subject: [PATCH] Phpdoc fixes. --- src/Interfaces/ArrayViewInterface.php | 6 +++--- src/Traits/ArrayViewAccessTrait.php | 4 +++- src/Views/ArrayView.php | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Interfaces/ArrayViewInterface.php b/src/Interfaces/ArrayViewInterface.php index a3407ee..92e5abb 100644 --- a/src/Interfaces/ArrayViewInterface.php +++ b/src/Interfaces/ArrayViewInterface.php @@ -17,7 +17,7 @@ * * @template T The type of elements in the array * - * @extends \ArrayAccess|ArrayViewInterface|ArraySelectorInterface, T|array> + * @extends \ArrayAccess|ArrayViewInterface|ArraySelectorInterface, T|array> * @extends \IteratorAggregate */ interface ArrayViewInterface extends \ArrayAccess, \IteratorAggregate, \Countable @@ -86,8 +86,8 @@ public function is(callable $predicate): MaskSelectorInterface; /** * Returns a subview of this view based on a selector or string slice. * - * @param string|array|ArrayViewInterface|ArraySelectorInterface $selector The selector or string - * to filter the subview. + * @param string|array|ArrayViewInterface|ArraySelectorInterface $selector The selector or + * string to filter the subview. * @param bool|null $readonly Flag indicating if the subview should be read-only. * * @return ArrayViewInterface A new view representing the subview of this view. diff --git a/src/Traits/ArrayViewAccessTrait.php b/src/Traits/ArrayViewAccessTrait.php index bf6d96f..3a4ed0a 100644 --- a/src/Traits/ArrayViewAccessTrait.php +++ b/src/Traits/ArrayViewAccessTrait.php @@ -22,7 +22,7 @@ * and unsetting elements in the ArrayView object. * * @template T Type of ArrayView values. - * @template S of string|array|ArrayViewInterface|ArraySelectorInterface Type of selectors. + * @template S of string|array|ArrayViewInterface|ArraySelectorInterface Selector type. */ trait ArrayViewAccessTrait { @@ -149,9 +149,11 @@ protected function toSelector($input): ArraySelectorInterface } if (\count($input) > 0 && \is_bool($input[0])) { + /** @var array $input */ return new MaskSelector($input); } + /** @var array $input */ return new IndexListSelector($input); } } diff --git a/src/Views/ArrayView.php b/src/Views/ArrayView.php index 38da822..70a80e1 100644 --- a/src/Views/ArrayView.php +++ b/src/Views/ArrayView.php @@ -32,7 +32,7 @@ class ArrayView implements ArrayViewInterface { /** - * @use ArrayViewAccessTrait|ArrayViewInterface|ArraySelectorInterface> + * @use ArrayViewAccessTrait|ArrayViewInterface|ArraySelectorInterface> * * for array access methods. */ @@ -274,7 +274,7 @@ public function is(callable $predicate): MaskSelectorInterface * $subview[0] = [11]; // throws ReadonlyError * ``` * - * @template S of string|array|ArrayViewInterface|ArraySelectorInterface + * @template S of string|array|ArrayViewInterface|ArraySelectorInterface Selector type. * * @param S $selector The selector or string to filter the subview. * @param bool|null $readonly Flag indicating if the subview should be read-only.