File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 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 */
2323interface 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.
Original file line number Diff line number Diff line change 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 */
2727trait 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}
Original file line number Diff line number Diff line change 3232class 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.
You can’t perform that action at this time.
0 commit comments