$item) { $value[$key] = self::canonicalize($item); } return $value; } private static function is_list_array(array $value): bool { $expected = 0; foreach ($value as $key => $_item) { if ($key !== $expected) { return false; } $expected++; } return true; } private static function bounded(string $value, int $length): string { return substr($value, 0, $length); } }