modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2024-06-06 17:32:07 +04:00
parent 5e140610c1
commit f35b0a400d
2 changed files with 40 additions and 0 deletions

View File

@ -39,4 +39,28 @@ class A {
static function merge(?array &$dest, ...$merges): void { static function merge(?array &$dest, ...$merges): void {
$dest = cl::merge($dest, ...$merges); $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);
}
} }

View File

@ -383,6 +383,22 @@ class cl {
return $dest; 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 * modifier la valeur au chemin de clé $keys dans le tableau $array
* *