<?php
namespace nur\sery\wip\schema\types;

use nur\sery\wip\schema\Result;
use nur\sery\wip\schema\Schema;

abstract class tcontent extends _tsimple {
  static function ensure_content(&$content): void {
    if (!is_string($content) && !is_array($content)) $content = strval($content);
  }

  static function ensure_ncontent(&$content): void {
    if ($content !== null) self::ensure_content($content);
  }

  function isValid($value, ?bool &$normalized=null): bool {
    $normalized = is_string($value) || is_array($value);
    return is_scalar($value) || is_array($value);
  }

  function verifix(&$value, Result &$result, Schema $schema): bool {
  }

  function format($value, $format=null): string {
  }
}
