modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2025-05-08 06:58:54 +04:00
parent b8a3d7ae77
commit bbbe101918
2 changed files with 7 additions and 7 deletions

View File

@ -241,7 +241,7 @@ class cl {
}
/**
* obtenir la liste des clés finalement obtenues après l'appel à
* obtenir la liste des clés qui seraient finalement obtenues après l'appel à
* {@link self::select()} avec le mapping spécifié
*/
static final function selected_keys(?array $mappings): array {
@ -284,7 +284,7 @@ class cl {
* $includes qui ne sont pas mentionnées dans $excludes.
*
* - si $includes===null && $excludes===null, retourner le tableau inchangé
* - si $includes vaut null, prendre toutes les clés
* - si $includes vaut null, c'est comme si toutes les clés étaient incluses
*
*/
static final function xselect($array, ?array $includes, ?array $excludes=null): ?array {

View File

@ -12,10 +12,10 @@ class clTest extends TestCase {
}
function test_same_keys() {
$array = ["a" => 42, "b" => "tesxt"]; $arrayKeys = array_keys($array);
$xarray = ["parasite0", "a" => 42, "parasite1", "b" => "tesxt"]; $xarrayKeys = array_keys($array);
$missingArray = ["c" => true]; $missingArrayKeys = array_keys($missingArray);
$ref = ["a" => "int", "b" => "text"]; $refKeys = array_keys($ref);
$missingArray = ["c" => true]; $missingKeys = array_keys($missingArray);
$missingRef = ["c" => "bool"]; $missingKeys = array_keys($missingRef);
$missingRef = ["c" => "bool"]; $missingRefKeys = array_keys($missingRef);
$xarray = ["parasite0", "a" => 42, "parasite1", "b" => "tesxt"];
$this->checkKeys(null, null, true, [], [], []);
$this->checkKeys(null, [], true, [], [], []);
@ -29,8 +29,8 @@ class clTest extends TestCase {
$this->checkKeys($array, [], true, [], $arrayKeys, []);
$this->checkKeys($array, $ref, true, $arrayKeys, [], []);
$this->checkKeys(cl::merge($array, $missingArray), $ref, true, $arrayKeys, $missingKeys, []);
$this->checkKeys($array, cl::merge($ref, $missingRef), false, $arrayKeys, [], $missingKeys);
$this->checkKeys(cl::merge($array, $missingArray), $ref, true, $arrayKeys, $missingArrayKeys, []);
$this->checkKeys($array, cl::merge($ref, $missingRef), false, $arrayKeys, [], $missingRefKeys);
$this->checkKeys($xarray, $ref, false, $arrayKeys, [0, 1], []);
}