From 300ad1f203cbd2c0ad3b9130e140121615cf7f6d Mon Sep 17 00:00:00 2001 From: Smoren Date: Wed, 13 Mar 2024 13:44:22 +0300 Subject: [PATCH] Examples added. --- src/Views/ArrayIndexListView.php | 9 +++++++++ src/Views/ArrayMaskView.php | 9 +++++++++ src/Views/ArraySliceView.php | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/Views/ArrayIndexListView.php b/src/Views/ArrayIndexListView.php index 978e51d..70cf9b2 100644 --- a/src/Views/ArrayIndexListView.php +++ b/src/Views/ArrayIndexListView.php @@ -16,6 +16,15 @@ * * @template T Type of array source elements. * + * + * subview(new IndexListSelector([0, 2, 4])); + * $view->toArray(); // [1, 3, 5] + * + * + * * @extends ArrayView */ class ArrayIndexListView extends ArrayView diff --git a/src/Views/ArrayMaskView.php b/src/Views/ArrayMaskView.php index 1f1bb5b..64d25bc 100644 --- a/src/Views/ArrayMaskView.php +++ b/src/Views/ArrayMaskView.php @@ -16,6 +16,15 @@ * * @template T * + * + * subview(new MaskSelector([true, false, true, false, true])); + * $view->toArray(); // [1, 3, 5] + * + * + * * @extends ArrayIndexListView */ class ArrayMaskView extends ArrayIndexListView diff --git a/src/Views/ArraySliceView.php b/src/Views/ArraySliceView.php index 83845e3..d25ead0 100644 --- a/src/Views/ArraySliceView.php +++ b/src/Views/ArraySliceView.php @@ -16,6 +16,15 @@ * * @template T * + * + * subview(new SliceSelector('::2')); + * $view->toArray(); // [1, 3, 5] + * + * + * * @extends ArrayView */ class ArraySliceView extends ArrayView