28 lines
854 B
PHP
28 lines
854 B
PHP
|
<?php
|
||
|
namespace nur\sery\schema;
|
||
|
|
||
|
use nur\sery\schema\types\IType;
|
||
|
use nur\sery\schema\values\AssocValue;
|
||
|
use nur\sery\schema\values\ListValue;
|
||
|
use nur\sery\schema\values\ScalarValue;
|
||
|
|
||
|
abstract class Value {
|
||
|
function isAssoc(?AssocValue &$assoc=null): bool { return false; }
|
||
|
function isList(?ListValue &$list=null): bool { return false; }
|
||
|
function isScalar(?ScalarValue &$scalar=null): bool { return false; }
|
||
|
|
||
|
abstract function reset(&$dest, $key=null, bool $verifix=true): self;
|
||
|
|
||
|
/** retourner le type associé à cette valeur */
|
||
|
abstract function getType(): IType;
|
||
|
|
||
|
/** retourner true si la valeur existe */
|
||
|
abstract function exists(): bool;
|
||
|
|
||
|
/** retourner true si la valeur est valide */
|
||
|
abstract function valid(): bool;
|
||
|
|
||
|
/** retourner true si la valeur est dans sa forme normalisée */
|
||
|
abstract function normalized(): bool;
|
||
|
}
|