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(); - } }