From 69203352d81b8a35c4bd36a35d619f9feee10ce3 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Mon, 17 Mar 2025 11:43:05 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/schema/Schema.php | 2 +- src/schema/TODO.md | 1 + src/schema/_scalar/ScalarResult.php | 1 - src/schema/_scalar/ScalarSchema.php | 5 +++++ src/schema/types/Registry.php | 2 +- tests/wip/schema/_assoc/AssocSchemaTest.php | 2 +- tests/wip/schema/_scalar/ScalarSchemaTest.php | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/schema/Schema.php b/src/schema/Schema.php index 0bbd86e..02365cb 100644 --- a/src/schema/Schema.php +++ b/src/schema/Schema.php @@ -164,7 +164,7 @@ abstract class Schema implements ArrayAccess { tcallable::ensure_ncallable($definition["normalizer_func"]); tarray::ensure_narray($definition["messages"]); tcallable::ensure_ncallable($definition["formatter_func"]); - tbool::ensure_nbool($definition["composite"]); + tbool::ensure_nbool($definition["computed"]); switch ($nature[0] ?? null) { case "assoc": diff --git a/src/schema/TODO.md b/src/schema/TODO.md index 46e80ce..5f50801 100644 --- a/src/schema/TODO.md +++ b/src/schema/TODO.md @@ -1,5 +1,6 @@ # nulib\schema +* instance de WrapperContext directement dans le schéma * plus de {key} ni {orig} dans messages * les messages standard ne sont utilisés que s'il n'y a pas de message dans l'exception diff --git a/src/schema/_scalar/ScalarResult.php b/src/schema/_scalar/ScalarResult.php index ee28c05..cb568d5 100644 --- a/src/schema/_scalar/ScalarResult.php +++ b/src/schema/_scalar/ScalarResult.php @@ -1,7 +1,6 @@ newWrapper(); + return $wrapper->reset($value, $valueKey, false); + } if (!($wrapper instanceof ScalarWrapper)) $wrapper = $this->newWrapper(); return $wrapper->reset($value, $valueKey); } diff --git a/src/schema/types/Registry.php b/src/schema/types/Registry.php index e7bdecd..fdaabde 100644 --- a/src/schema/types/Registry.php +++ b/src/schema/types/Registry.php @@ -17,7 +17,7 @@ class Registry { "array" => tarray::class, "callable" => tcallable::class, # types spéciaux - "raw" => tmixed::class, + "raw" => traw::class, "mixed" => tmixed::class, "key" => tkey::class, "pkey" => tpkey::class, diff --git a/tests/wip/schema/_assoc/AssocSchemaTest.php b/tests/wip/schema/_assoc/AssocSchemaTest.php index 25ebc31..4ac9fca 100644 --- a/tests/wip/schema/_assoc/AssocSchemaTest.php +++ b/tests/wip/schema/_assoc/AssocSchemaTest.php @@ -25,7 +25,7 @@ class AssocSchemaTest extends TestCase { "name" => null, "pkey" => null, "header" => null, - "composite" => null, + "computed" => null, ]; static function schema(array $definition, array $keyDefinitions): array { diff --git a/tests/wip/schema/_scalar/ScalarSchemaTest.php b/tests/wip/schema/_scalar/ScalarSchemaTest.php index 84fdd35..c862fa5 100644 --- a/tests/wip/schema/_scalar/ScalarSchemaTest.php +++ b/tests/wip/schema/_scalar/ScalarSchemaTest.php @@ -24,7 +24,7 @@ class ScalarSchemaTest extends TestCase { "name" => null, "pkey" => null, "header" => null, - "composite" => null, + "computed" => null, ]; static function schema(array $schema): array {