Skip to content

Commit 5d301bd

Browse files
committed
Phpdoc fixes.
1 parent 27fd05e commit 5d301bd

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Interfaces/ArrayViewInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @template T The type of elements in the array
1919
*
20-
* @extends \ArrayAccess<int|string|array<mixed>|ArrayViewInterface<mixed>|ArraySelectorInterface, T|array<T>>
20+
* @extends \ArrayAccess<int|string|array<int|bool>|ArrayViewInterface<int|bool>|ArraySelectorInterface, T|array<T>>
2121
* @extends \IteratorAggregate<int, T>
2222
*/
2323
interface ArrayViewInterface extends \ArrayAccess, \IteratorAggregate, \Countable
@@ -86,8 +86,8 @@ public function is(callable $predicate): MaskSelectorInterface;
8686
/**
8787
* Returns a subview of this view based on a selector or string slice.
8888
*
89-
* @param string|array<mixed>|ArrayViewInterface<mixed>|ArraySelectorInterface $selector The selector or string
90-
* to filter the subview.
89+
* @param string|array<int|bool>|ArrayViewInterface<int|bool>|ArraySelectorInterface $selector The selector or
90+
* string to filter the subview.
9191
* @param bool|null $readonly Flag indicating if the subview should be read-only.
9292
*
9393
* @return ArrayViewInterface<T> A new view representing the subview of this view.

src/Traits/ArrayViewAccessTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* and unsetting elements in the ArrayView object.
2323
*
2424
* @template T Type of ArrayView values.
25-
* @template S of string|array<mixed>|ArrayViewInterface<mixed>|ArraySelectorInterface Type of selectors.
25+
* @template S of string|array<int|bool>|ArrayViewInterface<int|bool>|ArraySelectorInterface Selector type.
2626
*/
2727
trait ArrayViewAccessTrait
2828
{
@@ -149,9 +149,11 @@ protected function toSelector($input): ArraySelectorInterface
149149
}
150150

151151
if (\count($input) > 0 && \is_bool($input[0])) {
152+
/** @var array<bool> $input */
152153
return new MaskSelector($input);
153154
}
154155

156+
/** @var array<int> $input */
155157
return new IndexListSelector($input);
156158
}
157159
}

src/Views/ArrayView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class ArrayView implements ArrayViewInterface
3333
{
3434
/**
35-
* @use ArrayViewAccessTrait<T, string|array<mixed>|ArrayViewInterface<mixed>|ArraySelectorInterface>
35+
* @use ArrayViewAccessTrait<T, string|array<int|bool>|ArrayViewInterface<int|bool>|ArraySelectorInterface>
3636
*
3737
* for array access methods.
3838
*/
@@ -274,7 +274,7 @@ public function is(callable $predicate): MaskSelectorInterface
274274
* $subview[0] = [11]; // throws ReadonlyError
275275
* ```
276276
*
277-
* @template S of string|array<mixed>|ArrayViewInterface<mixed>|ArraySelectorInterface
277+
* @template S of string|array<int|bool>|ArrayViewInterface<int|bool>|ArraySelectorInterface Selector type.
278278
*
279279
* @param S $selector The selector or string to filter the subview.
280280
* @param bool|null $readonly Flag indicating if the subview should be read-only.

0 commit comments

Comments
 (0)