From f35b0a400d22de7e5b5569de33cd51def63de0e3 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 6 Jun 2024 17:32:07 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/A.php | 24 ++++++++++++++++++++++++ src/cl.php | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/src/A.php b/src/A.php index 23196f8..8cfafdb 100644 --- a/src/A.php +++ b/src/A.php @@ -39,4 +39,28 @@ class A { static function merge(?array &$dest, ...$merges): void { $dest = cl::merge($dest, ...$merges); } + + static final function select(?array &$dest, ?array $mappings, bool $inverse=false): void { + $dest = cl::select($dest, $mappings, $inverse); + } + + static final function selectm(?array &$dest, ?array $mappings, ?array $merge=null): void { + $dest = cl::selectm($dest, $mappings, $merge); + } + + static final function mselect(?array &$dest, ?array $merge, ?array $mappings): void { + $dest = cl::mselect($dest, $merge, $mappings); + } + + static final function pselect(?array &$dest, ?array $pkeys): void { + $dest = cl::pselect($dest, $pkeys); + } + + static final function pselectm(?array &$dest, ?array $pkeys, ?array $merge=null): void { + $dest = cl::pselectm($dest, $pkeys, $merge); + } + + static final function mpselect(?array &$dest, ?array $merge, ?array $pkeys): void { + $dest = cl::mpselect($dest, $merge, $pkeys); + } } diff --git a/src/cl.php b/src/cl.php index e5dbf11..1144709 100644 --- a/src/cl.php +++ b/src/cl.php @@ -383,6 +383,22 @@ class cl { return $dest; } + /** + * méthode de convenance qui sélectionne certaines clés de $array avec + * {@link self::pselect()} puis merge le tableau $merge au résultat. + */ + static final function pselectm($array, ?array $pkeys, ?array $merge=null): array { + return cl::merge(self::pselect($array, $pkeys), $merge); + } + + /** + * méthode de convenance qui merge $merge dans $array puis sélectionne + * certaines clés avec {@link self::pselect()} + */ + static final function mpselect($array, ?array $merge, ?array $mappings): array { + return self::pselect(cl::merge($array, $merge), $mappings); + } + /** * modifier la valeur au chemin de clé $keys dans le tableau $array *