From d1cfcf2fb647248e5163d6d273a7cd097b350fd5 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 18 Jun 2022 12:20:34 +0300 Subject: [PATCH] feat(expressions): add `filterCollection` expression function --- .../core/Entries/Expressions/CollectionExpression.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/flextype/core/Entries/Expressions/CollectionExpression.php b/src/flextype/core/Entries/Expressions/CollectionExpression.php index 5e4f2b31..0a4b81cd 100644 --- a/src/flextype/core/Entries/Expressions/CollectionExpression.php +++ b/src/flextype/core/Entries/Expressions/CollectionExpression.php @@ -27,8 +27,9 @@ class CollectionExpression implements ExpressionFunctionProviderInterface new ExpressionFunction('collection', fn($items = null) => 'collection($items)', fn($arguments, $items = null) => collection($items)), new ExpressionFunction('collectionFromJson', fn(string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => 'collectionFromJson($input, $assoc, $depth, $flags)', fn($arguments, string $input, bool $assoc = true, int $depth = 512, int $flags = 0) => collectionFromJson($input, $assoc, $depth, $flags)), new ExpressionFunction('collectionFromString', fn(string $string, string $separator) => 'collectionFromString($string, $separator)', fn($arguments, string $string, string $separator) => collectionFromString($string, $separator)), - new ExpressionFunction('collectionWithRange', fn($low, $high, int $step = 1) => 'collection($low, $high, $step)', fn($arguments, $low, $high, int $step = 1) => collectionWithRange($low, $high, $step)), - new ExpressionFunction('collectionFromQueryString', fn(string $string) => 'collection($string)', fn($arguments, string $string) => collectionFromQueryString($string)), + new ExpressionFunction('collectionWithRange', fn($low, $high, int $step = 1) => 'collectionWithRange($low, $high, $step)', fn($arguments, $low, $high, int $step = 1) => collectionWithRange($low, $high, $step)), + new ExpressionFunction('collectionFromQueryString', fn(string $string) => 'collectionFromQueryString($string)', fn($arguments, string $string) => collectionFromQueryString($string)), + new ExpressionFunction('filterCollection', fn($items = [], array $options = []) => 'filterCollection($items, $options)', fn($arguments, $items = [], array $options = []) => filterCollection($items, $options)), ]; } } \ No newline at end of file