From bcd01643d7ee609106b91d581f01c1c71e8c2b7b Mon Sep 17 00:00:00 2001 From: Dmitrii Fediuk Date: Mon, 3 Jun 2024 01:34:37 +0100 Subject: [PATCH] https://github.com/mage2pro/core/issues/404 --- Core/lib/array/clean/filter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/lib/array/clean/filter.php b/Core/lib/array/clean/filter.php index 75b6363cd..bd3154fd0 100644 --- a/Core/lib/array/clean/filter.php +++ b/Core/lib/array/clean/filter.php @@ -34,15 +34,15 @@ function df_filter($a1, $a2):array {return df_filter_f($a1, $a2, 'array_filter') * 2) We still can not use «Union Types» (e.g. `callable|iterable`) because they require PHP ≥ 8 (we need to support PHP ≥ 7.1): * https://php.watch/versions/8.0/union-types * https://3v4l.org/AOWmO + * 3) "Use the `callable` type": https://github.com/mage2pro/core/issues/404 * @used-by df_filter() * @used-by df_filter_head() * @used-by df_filter_tail() * @param callable|iterable $a1 * @param callable|iterable $a2 - * @param callable $fA * @return array(int|string => mixed) */ -function df_filter_f($a1, $a2, $fA):array {/** @var array $r */ +function df_filter_f($a1, $a2, callable $fA):array {/** @var array $r */ # 2020-03-02, 2022-10-31 # 1) Symmetric array destructuring requires PHP ≥ 7.1: # [$a, $b] = [1, 2];