Skip to content

Commit

Permalink
Examples added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed Mar 13, 2024
1 parent c5d2d6e commit 300ad1f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Views/ArrayIndexListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
*
* @template T Type of array source elements.
*
* <code>
* <?php
*
* $source = [1, 2, 3, 4, 5];
* $view = ArrayView::toView($source)->subview(new IndexListSelector([0, 2, 4]));
* $view->toArray(); // [1, 3, 5]
*
* </code>
*
* @extends ArrayView<T>
*/
class ArrayIndexListView extends ArrayView
Expand Down
9 changes: 9 additions & 0 deletions src/Views/ArrayMaskView.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
*
* @template T
*
* <code>
* <?php
*
* $source = [1, 2, 3, 4, 5];
* $view = ArrayView::toView($source)->subview(new MaskSelector([true, false, true, false, true]));
* $view->toArray(); // [1, 3, 5]
*
* </code>
*
* @extends ArrayIndexListView<T>
*/
class ArrayMaskView extends ArrayIndexListView
Expand Down
9 changes: 9 additions & 0 deletions src/Views/ArraySliceView.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
*
* @template T
*
* <code>
* <?php
*
* $source = [1, 2, 3, 4, 5];
* $view = ArrayView::toView($source)->subview(new SliceSelector('::2'));
* $view->toArray(); // [1, 3, 5]
*
* </code>
*
* @extends ArrayView<T>
*/
class ArraySliceView extends ArrayView
Expand Down

0 comments on commit 300ad1f

Please sign in to comment.