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

class tpkey implements IType {
  static function ensure_pkey(&$pkey): void {
    if (!is_string($pkey) && !is_int($pkey) && !is_array($pkey)) $pkey = strval($pkey);
    if (is_array($pkey)) {
      foreach ($pkey as &$key) {
        tkey::ensure_key($key);
      };
      unset($key);
    }
  }

  static function ensure_npkey(&$pkey): void {
    if ($pkey !== null) self::ensure_pkey($pkey);
  }
}
