From 5f15e1ea8c49b741ead563104557b8e1650c2720 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 20 Oct 2023 10:25:20 +0400 Subject: [PATCH] correction php --- .idea/.gitignore | 8 ----- .idea/codeception.xml | 15 -------- .idea/nulib.iml | 8 ++--- .idea/php-docker-settings.xml | 15 -------- .idea/php.xml | 48 ++++++++++++------------- .idea/phpspec.xml | 13 ------- .idea/phpunit.xml | 10 ------ .idea/vcs.xml | 1 - composer.lock | 8 ++--- php/src_base/cl.php | 8 ++--- php/src_base/{cstr.php => str.php} | 4 +-- php/tests/cstrTest.php | 56 ------------------------------ php/tests/strTest.php | 56 ++++++++++++++++++++++++++++++ 13 files changed, 93 insertions(+), 157 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/codeception.xml delete mode 100644 .idea/phpspec.xml delete mode 100644 .idea/phpunit.xml rename php/src_base/{cstr.php => str.php} (99%) delete mode 100644 php/tests/cstrTest.php create mode 100644 php/tests/strTest.php diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/codeception.xml b/.idea/codeception.xml deleted file mode 100644 index 9da3754..0000000 --- a/.idea/codeception.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/nulib.iml b/.idea/nulib.iml index ece91f0..cfcc99b 100644 --- a/.idea/nulib.iml +++ b/.idea/nulib.iml @@ -2,13 +2,11 @@ - - - - + + - + \ No newline at end of file diff --git a/.idea/php-docker-settings.xml b/.idea/php-docker-settings.xml index d039669..5c353a5 100644 --- a/.idea/php-docker-settings.xml +++ b/.idea/php-docker-settings.xml @@ -3,21 +3,6 @@ - - - - - - - diff --git a/.idea/php.xml b/.idea/php.xml index 988f6b9..31366f8 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -12,36 +12,36 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - + diff --git a/.idea/phpspec.xml b/.idea/phpspec.xml deleted file mode 100644 index ec7e1d4..0000000 --- a/.idea/phpspec.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104c..0000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 8306744..35eb1dd 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,6 +2,5 @@ - \ No newline at end of file diff --git a/composer.lock b/composer.lock index ba7dfde..1b8c104 100644 --- a/composer.lock +++ b/composer.lock @@ -198,7 +198,7 @@ "source": { "type": "git", "url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git", - "reference": "8902035bef6ddfe9864675a00844dd14872f6d13" + "reference": "6758a43c241cf51ab3ecff3d2260a583f20c0b19" }, "require": { "php": ">=7.3", @@ -207,12 +207,12 @@ "type": "library", "autoload": { "psr-4": { - "mur\\tests\\": "src" + "nulib\\tests\\": "src" } }, "autoload-dev": { "psr-4": { - "mur\\tests\\": "tests" + "nulib\\tests\\": "tests" } }, "authors": [ @@ -222,7 +222,7 @@ } ], "description": "fonctions et classes pour les tests", - "time": "2023-10-01T11:57:55+00:00" + "time": "2023-10-20T06:17:30+00:00" }, { "name": "phar-io/manifest", diff --git a/php/src_base/cl.php b/php/src_base/cl.php index 960abde..4d85ded 100644 --- a/php/src_base/cl.php +++ b/php/src_base/cl.php @@ -445,10 +445,10 @@ class cl { static final function compare(array $keys): callable { return function ($a, $b) use ($keys) { foreach ($keys as $key) { - if (cstr::del_prefix($key, "+")) $w = 1; - elseif (cstr::del_prefix($key, "-")) $w = -1; - elseif (cstr::del_suffix($key, "|asc")) $w = 1; - elseif (cstr::del_suffix($key, "|desc")) $w = -1; + if (str::del_prefix($key, "+")) $w = 1; + elseif (str::del_prefix($key, "-")) $w = -1; + elseif (str::del_suffix($key, "|asc")) $w = 1; + elseif (str::del_suffix($key, "|desc")) $w = -1; else $w = 1; if ($c = $w * cv::compare(cl::get($a, $key), cl::get($b, $key))) { return $c; diff --git a/php/src_base/cstr.php b/php/src_base/str.php similarity index 99% rename from php/src_base/cstr.php rename to php/src_base/str.php index 85a1957..ecbb538 100644 --- a/php/src_base/cstr.php +++ b/php/src_base/str.php @@ -2,9 +2,9 @@ namespace nulib; /** - * Class cstr: gestion des chaines de caractère "simples" + * Class str: gestion des chaines de caractère "simples" */ -class cstr { +class str { /** * Retourner $s converti en chaine non nulle, ou "" si $s est fausse (cela * n'inclue pas la chaine "0") diff --git a/php/tests/cstrTest.php b/php/tests/cstrTest.php deleted file mode 100644 index 132a538..0000000 --- a/php/tests/cstrTest.php +++ /dev/null @@ -1,56 +0,0 @@ -