From de6d4d69e7b8558797ff6b3d46412777858c6c76 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 20 Jun 2024 19:05:13 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/A.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/A.php b/src/A.php index 3123a9d..f4062de 100644 --- a/src/A.php +++ b/src/A.php @@ -191,4 +191,21 @@ class A { return $values; } + static final function filter_if(&$dest, callable $cond): void { + self::ensure_narray($dest); + $dest = cl::filter_if($dest, $cond); + } + + static final function filter_z(?array $dest): void { self::filter_if($dest, [cv::class, "z"]);} + static final function filter_nz(?array $dest): void { self::filter_if($dest, [cv::class, "nz"]);} + static final function filter_n(?array $dest): void { self::filter_if($dest, [cv::class, "n"]);} + static final function filter_nn(?array $dest): void { self::filter_if($dest, [cv::class, "nn"]);} + static final function filter_t(?array $dest): void { self::filter_if($dest, [cv::class, "t"]);} + static final function filter_f(?array $dest): void { self::filter_if($dest, [cv::class, "f"]);} + static final function filter_pt(?array $dest): void { self::filter_if($dest, [cv::class, "pt"]);} + static final function filter_pf(?array $dest): void { self::filter_if($dest, [cv::class, "pf"]);} + static final function filter_equals(?array $dest, $value): void { self::filter_if($dest, cv::equals($value)); } + static final function filter_not_equals(?array $dest, $value): void { self::filter_if($dest, cv::not_equals($value)); } + static final function filter_same(?array $dest, $value): void { self::filter_if($dest, cv::same($value)); } + static final function filter_not_same(?array $dest, $value): void { self::filter_if($dest, cv::not_same($value)); } }