From b299fc813918d2dc86cb2de5fa6af195159e8bda Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sat, 25 Nov 2023 10:05:01 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/schema/OldSchema.php | 41 ---------------------------------------- 1 file changed, 41 deletions(-) diff --git a/src/schema/OldSchema.php b/src/schema/OldSchema.php index 8472085..f5d98b2 100644 --- a/src/schema/OldSchema.php +++ b/src/schema/OldSchema.php @@ -1,13 +1,6 @@ isScalar()) return false; - if ($value instanceof Input) $input = $value; - else $input = new Input($value); - $scalar = new ScalarValue($input, $this->schema, $key); - return true; - } - - /** retourner true la valeur est un tableau séquentiel */ - function getList(&$value, $key=null, ?ListValue &$list=null): bool { - if (!$this->isSeq()) return false; - if ($value instanceof Input) $input = $value; - else $input = new Input($value); - $list = new ListValue($input, $this->schema, $key); - return true; - } - - /** retourner true la valeur est un tableau associatif */ - function getAssoc(&$value, $key=null, ?AssocValue &$assoc=null): bool { - if (!$this->isAssoc()) return false; - if ($value instanceof Input) $input = $value; - else $input = new Input($value); - $assoc = new AssocValue($input, $this->schema, $key); - return true; - } - - function getValue(&$value, $key=null): IValue { - if ($this->getScalar($value, $key, $scalar)) return $scalar; - elseif ($this->getList($value, $key, $seq)) return $seq; - elseif ($this->getAssoc($value, $key, $assoc)) return $assoc; - else throw StateException::unexpected_state(); - } }