From bbbe10191860c819925f805a898baf8029fe48da Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 8 May 2025 06:58:54 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- php/src/cl.php | 4 ++-- php/tests/clTest.php | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/php/src/cl.php b/php/src/cl.php index ebbcca9..78dcb9b 100644 --- a/php/src/cl.php +++ b/php/src/cl.php @@ -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 { diff --git a/php/tests/clTest.php b/php/tests/clTest.php index d2b834f..bedec17 100644 --- a/php/tests/clTest.php +++ b/php/tests/clTest.php @@ -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], []); }