"list", "schema" => $definition[0], ]; } self::_normalize($definition, $definitionKey); self::_ensure_nature($definition, "list", "array"); return $definition; } function __construct($definition=null, $definitionKey=null, bool $normalize=true) { if ($definition === null) $definition = static::SCHEMA; if ($normalize) { $definition = self::normalize($definition, $definitionKey); $this->_definition = $definition; self::_ensure_type($definition); self::_ensure_schema_instances($definition); } $this->definition = $definition; } function isList(?ListSchema &$schema=null): bool { $schema = $this; return true; } protected function newWrapper(): ListWrapper { return new ListWrapper($this); } function getWrapper(&$value=null, $valueKey=null, ?Wrapper &$wrapper=null): ListWrapper { if (!($wrapper instanceof ListWrapper)) $wrapper = $this->newWrapper(); return $wrapper->reset($value, $valueKey); } }