* @generate-function-entries static
*/
-
namespace ion;
+
+function serialize(mixed $data, ?Serializer $serializer = null) : string {}
+/** @param string|resource $data */
+function unserialize($data, ?Unserializer $unserializer = null) : mixed {}
+
+interface Serializer {
+ public function serialize(mixed $data) : string;
+}
+interface Unserializer {
+ /** @param string|resource $data */
+ public function unserialize($data) : mixed;
+}
+
enum Type : int {
case Null = 0x000;
case Bool = 0x100;
case NONE =-0x200;
}
+class Symbol {
+ public function __construct(
+ public readonly ?string $value = null,
+ public readonly int $sid = -1,
+ public readonly ?Symbol\ImportLocation $importLocation = null,
+ ) {}
+
+ public function equals(Symbol $symbol): bool {}
+ public function __toString() : string {}
+ /** @alias ion\Symbol::__toString */
+ public function toString() : string {}
+}
+
+class Catalog implements Countable {
+ /** Internal cache */
+ private array $symbolTables = [];
+
+ public function __construct() {}
+
+ public function count() : int {}
+
+ public function add(Symbol\Table $table) : void {}
+ public function remove(Symbol\Table|string $table) : bool {}
+
+ public function find(string $name, int $version = 0) : ?Symbol\Table {}
+ public function findBest(string $name, int $version = 0) : ?Symbol\Table {}
+}
+
+class LOB {
+ public function __construct(
+ public readonly string $value,
+ public readonly Type $type = Type::CLob,
+ ) {
+ }
+}
+
+class Decimal {
+ public function __construct(
+ public readonly string|int $number,
+ public readonly ?Decimal\Context $context = null,
+ ) {}
+
+ public function equals(Decimal $decimal) : bool {}
+ public function isInt() : bool {}
+
+ public function __toString() : string {}
+ /** @alias ion\Decimal::__toString */
+ public function toString() : string {}
+ public function toInt() : int {}
+}
+
+class Timestamp extends \DateTime {
+ public readonly int $precision;
+ public readonly string $format;
+
+ public function __construct(
+ Timestamp\Precision|int $precision,
+ Timestamp\Format|string|null $format = null,
+ ?string $datetime = null,
+ ?\DateTimeZone $timezone = null,
+ ) {}
+
+ public function __toString() : string {}
+}
+
+interface Reader extends \RecursiveIterator {
+ public function getType() : Type;
+ public function hasAnnotations() : bool;
+ public function hasAnnotation(string $annotation) : bool;
+ public function isNull() : bool;
+ public function isInStruct() : bool;
+ public function getFieldName() : string;
+ public function getFieldNameSymbol() : Symbol;
+ public function getAnnotations() : array;
+ public function getAnnotationSymbols() : array;
+ public function countAnnotations() : int;
+ public function getAnnotation(int $index) : string;
+ public function getAnnotationSymbol(int $index) : Symbol;
+
+ public function readNull() : Type;
+ public function readBool() : bool;
+ public function readInt() : int|string;
+ public function readFloat() : float;
+ public function readDecimal() : Decimal;
+ public function readTimestamp() : Timestamp;
+ public function readSymbol() : Symbol;
+ public function readString() : string;
+ /** @param ref $string */
+ public function readStringPart(&$string, int $length = 0x1000) : bool;
+ public function readLob() : string;
+ /** @param ref $string */
+ public function readLobPart(&$string, int $length = 0x1000) : bool;
+
+ public function getPosition() : int;
+ public function getDepth() : int;
+
+ public function seek(int $offset, int $length = -1) : void;
+ /*
+ public function getSymbolTable() : SymbolTable;
+ public function setSymbolTable(SymbolTable $table) : void;
+ */
+ public function getValueOffset() : int;
+ public function getValueLength() : int;
+}
+
+interface Writer {
+ public function writeNull() : void;
+ public function writeTypedNull(Type $type) : void;
+ public function writeBool(bool $value) : void;
+ public function writeInt(int|string $value) : void;
+ public function writeFloat(float $value) : void;
+ public function writeDecimal(Decimal|string $value) : void;
+ public function writeTimestamp(Timestamp|string $value) : void;
+ public function writeSymbol(Symbol|string $value) : void;
+ public function writeString(string $value) : void;
+ public function writeCLob(string $value) : void;
+ public function writeBLob(string $value) : void;
+
+ public function startLob(Type $type) : void;
+ public function appendLob(string $data) : void;
+ public function finishLob() : void;
+
+ public function startContainer(Type $type) : void;
+ public function finishContainer() : void;
+
+ public function writeFieldName(string $name) : void;
+
+ public function writeAnnotation(Symbol|string ...$annotation) : void;
+
+ public function getDepth() : int;
+ public function flush() : int;
+ public function finish() : int;
+
+ // public function writeOne(Reader $reader) : void;
+ // public function writeAll(Reader $reader) : void;
+
+ // public function getCatalog() : Catalog;
+ // public function setCatalog(Catalog $catalog) : void;
+
+ // public function getSymbolTable() : Symbol\Table;
+ // puvlic function setSymbolTable(Symbol\Table $table) : void;
+}
+
namespace ion\Symbol;
+
class ImportLocation {
public function __construct(
public readonly string $name,
) {}
}
-namespace ion\Symbol;
interface Enum {
public function toSymbol() : \ion\Symbol;
public function toSID() : int;
public function toString() : string;
}
+interface Table {
+ public function getMaxId() : int;
+
+ public function add(\ion\Symbol|string $symbol) : int;
+ public function find(string|int $id) : ?\ion\Symbol;
+ public function findLocal(string|int $id) : ?\ion\Symbol;
+}
+
namespace ion\Symbol\Table;
+
+function PHP() : \ion\Symbol\Table {}
+function System() : \ion\Symbol\Table {}
+
enum System : string implements \ion\Symbol\Enum {
case Ion = '$ion';
case Ivm_1_0 = '$ion_1_0';
public function toString() : string {}
}
-namespace ion\Symbol\Table;
enum PHP : string implements \ion\Symbol\Enum {
case PHP = 'PHP';
case Reference = 'R';
public function toString() : string {}
}
-namespace ion;
-class Symbol {
- public function __construct(
- public readonly ?string $value = null,
- public readonly int $sid = -1,
- public readonly ?Symbol\ImportLocation $importLocation = null,
- ) {}
-
- public function equals(Symbol $symbol): bool {}
- public function __toString() : string {}
- /** @alias ion\Symbol::__toString */
- public function toString() : string {}
-}
-
-namespace ion\Symbol;
-interface Table {
- public function getMaxId() : int;
-
- public function add(\ion\Symbol|string $symbol) : int;
- public function find(string|int $id) : ?\ion\Symbol;
- public function findLocal(string|int $id) : ?\ion\Symbol;
-}
-
-namespace ion\Symbol\Table;
-function PHP() : \ion\Symbol\Table {}
-function System() : \ion\Symbol\Table {}
-
-namespace ion\Symbol\Table;
class Local implements \ion\Symbol\Table {
/** Internal cache */
private array $imports = [];
public function findLocal(string|int $id) : ?\ion\Symbol {}
}
-namespace ion\Symbol\Table;
class Shared implements \ion\Symbol\Table {
public function __construct(
public readonly string $name,
public function findLocal(string|int $id) : ?\ion\Symbol {}
}
-namespace ion;
-class Catalog implements Countable {
- /** Internal cache */
- private array $symbolTables = [];
-
- public function __construct() {}
-
- public function count() : int {}
-
- public function add(Symbol\Table $table) : void {}
- public function remove(Symbol\Table|string $table) : bool {}
-
- public function find(string $name, int $version = 0) : ?Symbol\Table {}
- public function findBest(string $name, int $version = 0) : ?Symbol\Table {}
-}
-
-namespace ion;
-class LOB {
- public function __construct(
- public readonly string $value,
- public readonly Type $type = Type::CLob,
- ) {
- }
-}
-
-namespace ion\Decimal\Context;
-enum Rounding : int {
- case Ceiling = 0;
- case Up = 1;
- case HalfUp = 2;
- case HalfEven = 3;
- case HalfDown = 4;
- case Down = 5;
- case Floor = 6;
- case Down05Up = 7;
-}
-
namespace ion\Decimal;
+
class Context {
public function __construct(
public readonly int $digits,
public static function DecMax(Context\Rounding|int $round = Context\Rounding::HalfEven) : Context {}
}
-namespace ion;
-class Decimal {
- public function __construct(
- public readonly string|int $number,
- public readonly ?Decimal\Context $context = null,
- ) {}
-
- public function equals(Decimal $decimal) : bool {}
- public function isInt() : bool {}
+namespace ion\Decimal\Context;
- public function __toString() : string {}
- /** @alias ion\Decimal::__toString */
- public function toString() : string {}
- public function toInt() : int {}
+enum Rounding : int {
+ case Ceiling = 0;
+ case Up = 1;
+ case HalfUp = 2;
+ case HalfEven = 3;
+ case HalfDown = 4;
+ case Down = 5;
+ case Floor = 6;
+ case Down05Up = 7;
}
namespace ion\Timestamp;
+
enum Precision : int {
case Year = 0x1;
case Month = 0x1|0x2;
case FracTZ = 0x1|0x2|0x4|0x10|0x20|0x40|0x80;
}
-namespace ion\Timestamp;
enum Format : string {
case Year = "Y\T";
case Month = "Y-m\T";
case SecTZ = "Y-m-d\TH:i:sP";
case FracTZ = "Y-m-d\TH:i:s.vP";
}
-namespace ion;
-class Timestamp extends \DateTime {
- public readonly int $precision;
- public readonly string $format;
-
- public function __construct(
- Timestamp\Precision|int $precision,
- Timestamp\Format|string|null $format = null,
- ?string $datetime = null,
- ?\DateTimeZone $timezone = null,
- ) {}
-
- public function __toString() : string {}
-}
-
-
-namespace ion;
-interface Reader extends \RecursiveIterator {
- public function getType() : Type;
- public function hasAnnotations() : bool;
- public function hasAnnotation(string $annotation) : bool;
- public function isNull() : bool;
- public function isInStruct() : bool;
- public function getFieldName() : string;
- public function getFieldNameSymbol() : Symbol;
- public function getAnnotations() : array;
- public function getAnnotationSymbols() : array;
- public function countAnnotations() : int;
- public function getAnnotation(int $index) : string;
- public function getAnnotationSymbol(int $index) : Symbol;
-
- public function readNull() : Type;
- public function readBool() : bool;
- public function readInt() : int|string;
- public function readFloat() : float;
- public function readDecimal() : Decimal;
- public function readTimestamp() : Timestamp;
- public function readSymbol() : Symbol;
- public function readString() : string;
- /** @param ref $string */
- public function readStringPart(&$string, int $length = 0x1000) : bool;
- public function readLob() : string;
- /** @param ref $string */
- public function readLobPart(&$string, int $length = 0x1000) : bool;
-
- public function getPosition() : int;
- public function getDepth() : int;
-
- public function seek(int $offset, int $length = -1) : void;
- /*
- public function getSymbolTable() : SymbolTable;
- public function setSymbolTable(SymbolTable $table) : void;
- */
- public function getValueOffset() : int;
- public function getValueLength() : int;
-}
namespace ion\Reader;
+
class Options {
public function __construct(
public readonly ?\ion\Catalog $catalog = null,
) {}
}
-namespace ion\Reader;
abstract class Reader implements \ion\Reader {
public readonly ?Options $options;
public function getValueOffset() : int {}
public function getValueLength() : int {}
}
-namespace ion\Reader;
+
interface Buffer extends \ion\Reader {
public function getBuffer() : string;
}
+interface Stream extends \ion\Reader {
+ /** @return resource */
+ public function getStream();
+ /** @param resource $stream */
+ public function resetStream($stream) : void;
+ /** @param resource $stream */
+ public function resetStreamWithLength($stream, int $length) : void;
+}
+
namespace ion\Reader\Buffer;
+
class Reader extends \ion\Reader\Reader implements \ion\Reader\Buffer {
public function __construct(
string $buffer,
public function getBuffer() : string {}
}
-namespace ion\Reader;
-interface Stream extends \ion\Reader {
- /** @return resource */
- public function getStream();
- /** @param resource $stream */
- public function resetStream($stream) : void;
- /** @param resource $stream */
- public function resetStreamWithLength($stream, int $length) : void;
-}
-
namespace ion\Reader\Stream;
+
class Reader extends \ion\Reader\Reader implements \ion\Reader\Stream {
/** @param resource $stream */
public function __construct(
}
namespace ion\Writer;
+
class Options {
public function __construct(
public readonly ?\ion\Catalog $catalog = null,
) {}
}
-namespace ion;
-interface Writer {
- public function writeNull() : void;
- public function writeTypedNull(Type $type) : void;
- public function writeBool(bool $value) : void;
- public function writeInt(int|string $value) : void;
- public function writeFloat(float $value) : void;
- public function writeDecimal(Decimal|string $value) : void;
- public function writeTimestamp(Timestamp|string $value) : void;
- public function writeSymbol(Symbol|string $value) : void;
- public function writeString(string $value) : void;
- public function writeCLob(string $value) : void;
- public function writeBLob(string $value) : void;
-
- public function startLob(Type $type) : void;
- public function appendLob(string $data) : void;
- public function finishLob() : void;
-
- public function startContainer(Type $type) : void;
- public function finishContainer() : void;
-
- public function writeFieldName(string $name) : void;
-
- public function writeAnnotation(Symbol|string ...$annotation) : void;
-
- public function getDepth() : int;
- public function flush() : int;
- public function finish() : int;
-
- // public function writeOne(Reader $reader) : void;
- // public function writeAll(Reader $reader) : void;
-
- // public function getCatalog() : Catalog;
- // public function setCatalog(Catalog $catalog) : void;
-
- // public function getSymbolTable() : Symbol\Table;
- // puvlic function setSymbolTable(Symbol\Table $table) : void;
-}
-
-namespace ion\Writer;
abstract class Writer implements \ion\Writer {
public function writeNull() : void {}
public function writeTypedNull(\ion\Type $type) : void {}
// public function writeAll(\ion\Reader $reader) : void {}
}
-namespace ion\Writer;
interface Buffer extends \ion\Writer {
public function getBuffer() : string;
public function resetBuffer() : void;
}
+interface Stream extends \ion\Writer {
+ /** @return resource */
+ public function getStream();
+}
+
namespace ion\Writer\Buffer;
+
class Writer extends \ion\Writer\Writer implements \ion\Writer\Buffer {
public function __construct(
?\ion\Writer\Options $options = null,
public function resetBuffer() : void {}
}
-namespace ion\Writer;
-interface Stream extends \ion\Writer {
- /** @return resource */
- public function getStream();
-}
-
namespace ion\Writer\Stream;
+
class Writer extends \ion\Writer\Writer implements \ion\Writer\Stream {
/** @param resource $stream */
public function __construct(
public function getStream() {}
}
-namespace ion;
-interface Serializer {
- public function serialize(mixed $data) : string;
-}
-namespace ion;
-interface Unserializer {
- /** @param string|resource $data */
- public function unserialize($data) : mixed;
-}
-
namespace ion\Serializer;
+
class PHP implements \ion\Serializer {
public function __construct(
public readonly ?\ion\Writer\Options $writerOptions = null,
}
namespace ion\Unserializer;
+
class PHP implements \ion\Unserializer {
public function __construct(
public readonly ?\ion\Reader\Options $readerOptions = null,
/** @param string|resource $data */
public function unserialize($data) : mixed {}
}
-
-namespace ion;
-function serialize(mixed $data, ?Serializer $serializer = null) : string {}
-/** @param string|resource $data */
-function unserialize($data, ?Unserializer $unserializer = null) : mixed {}