4 * @generate-class-entries static
5 * @generate-function-entries static
10 function serialize(mixed $data, ?Serializer
$serializer = null) : string {}
11 /** @param string|resource $data */
12 function unserialize($data, ?Unserializer
$unserializer = null) : mixed {}
14 interface Serializer
{
15 public function serialize(mixed $data) : string;
17 interface Unserializer
{
18 /** @param string|resource $data */
19 public function unserialize($data) : mixed;
28 case Timestamp
= 0x600;
36 case Datagram
= 0xf00;
43 public function __construct(
44 public readonly ?
string $value = null,
45 public readonly
int $sid = -1,
46 public readonly ?Symbol\ImportLocation
$importLocation = null,
49 public function equals(Symbol
$symbol): bool {}
50 public function __toString() : string {}
51 /** @alias ion\Symbol::__toString */
52 public function toString() : string {}
55 class Catalog
implements Countable
{
57 private array $symbolTables = [];
59 public function __construct() {}
61 public function count() : int {}
63 public function add(Symbol\Table
$table) : void
{}
64 public function remove(Symbol\Table|
string $table) : bool {}
66 public function find(string $name, int $version = 0) : ?Symbol\Table
{}
67 public function findBest(string $name, int $version = 0) : ?Symbol\Table
{}
71 public function __construct(
72 public readonly
string $value,
73 public readonly Type
$type = Type
::CLob
,
79 public function __construct(
80 public readonly
string|
int $number,
81 public readonly ?Decimal\Context
$context = null,
84 public function equals(Decimal
$decimal) : bool {}
85 public function isInt() : bool {}
87 public function __toString() : string {}
88 /** @alias ion\Decimal::__toString */
89 public function toString() : string {}
90 public function toInt() : int {}
93 class Timestamp
extends \DateTime
{
94 public readonly
int $precision;
95 public readonly
string $format;
97 public function __construct(
98 Timestamp\Precision|
int $precision,
99 Timestamp\Format|
string|
null $format = null,
100 ?
string $datetime = null,
101 ?\DateTimeZone
$timezone = null,
104 public function __toString() : string {}
107 interface Reader
extends \RecursiveIterator
{
108 public function getType() : Type
;
109 public function hasAnnotations() : bool;
110 public function hasAnnotation(string $annotation) : bool;
111 public function isNull() : bool;
112 public function isInStruct() : bool;
113 public function getFieldName() : string;
114 public function getFieldNameSymbol() : Symbol
;
115 public function getAnnotations() : array;
116 public function getAnnotationSymbols() : array;
117 public function countAnnotations() : int;
118 public function getAnnotation(int $index) : string;
119 public function getAnnotationSymbol(int $index) : Symbol
;
121 public function readNull() : Type
;
122 public function readBool() : bool;
123 public function readInt() : int|
string;
124 public function readFloat() : float;
125 public function readDecimal() : Decimal
;
126 public function readTimestamp() : Timestamp
;
127 public function readSymbol() : Symbol
;
128 public function readString() : string;
129 /** @param ref $string */
130 public function readStringPart(&$string, int $length = 0x1000) : bool;
131 public function readLob() : string;
132 /** @param ref $string */
133 public function readLobPart(&$string, int $length = 0x1000) : bool;
135 public function getPosition() : int;
136 public function getDepth() : int;
138 public function seek(int $offset, int $length = -1) : void
;
140 public function getSymbolTable() : SymbolTable;
141 public function setSymbolTable(SymbolTable $table) : void;
143 public function getValueOffset() : int;
144 public function getValueLength() : int;
148 public function writeNull() : void
;
149 public function writeTypedNull(Type
$type) : void
;
150 public function writeBool(bool $value) : void
;
151 public function writeInt(int|
string $value) : void
;
152 public function writeFloat(float $value) : void
;
153 public function writeDecimal(Decimal|
string $value) : void
;
154 public function writeTimestamp(Timestamp|
string $value) : void
;
155 public function writeSymbol(Symbol|
string $value) : void
;
156 public function writeString(string $value) : void
;
157 public function writeCLob(string $value) : void
;
158 public function writeBLob(string $value) : void
;
160 public function startLob(Type
$type) : void
;
161 public function appendLob(string $data) : void
;
162 public function finishLob() : void
;
164 public function startContainer(Type
$type) : void
;
165 public function finishContainer() : void
;
167 public function writeFieldName(string $name) : void
;
169 public function writeAnnotation(Symbol|
string ...$annotation) : void
;
171 public function getDepth() : int;
172 public function flush() : int;
173 public function finish() : int;
175 // public function writeOne(Reader $reader) : void;
176 // public function writeAll(Reader $reader) : void;
178 // public function getCatalog() : Catalog;
179 // public function setCatalog(Catalog $catalog) : void;
181 // public function getSymbolTable() : Symbol\Table;
182 // puvlic function setSymbolTable(Symbol\Table $table) : void;
185 namespace ion\Symbol
;
187 class ImportLocation
{
188 public function __construct(
189 public readonly
string $name,
190 public readonly
int $location,
195 public function toSymbol() : \ion\Symbol
;
196 public function toSID() : int;
197 public function toString() : string;
201 public function getMaxId() : int;
203 public function add(\ion\Symbol|
string $symbol) : int;
204 public function find(string|
int $id) : ?\ion\Symbol
;
205 public function findLocal(string|
int $id) : ?\ion\Symbol
;
208 namespace ion\Symbol\Table
;
210 function PHP() : \ion\Symbol\Table
{}
211 function System() : \ion\Symbol\Table
{}
213 enum System
: string implements \ion\Symbol\Enum
{
215 case Ivm_1_0
= '$ion_1_0';
216 case IonSymbolTable
= '$ion_symbol_table';
218 case Version
= 'version';
219 case Imports
= 'imports';
220 case Symbols
= 'symbols';
221 case MaxId
= 'max_id';
222 case SharedSymbolTable
= '$ion_shared_symbol_table';
224 /** @alias ion\Symbol\Enum::toSymbol */
225 public function toSymbol() : \ion\Symbol
{}
226 /** @alias ion\Symbol\Enum::toSID */
227 public function toSID() : int {}
228 /** @alias ion\Symbol\Enum::toString */
229 public function toString() : string {}
232 enum PHP
: string implements \ion\Symbol\Enum
{
234 case Reference
= 'R';
238 case ClassObject
= 'c';
239 case MagicObject
= 'O';
240 case CustomObject
= 'C';
242 case Serializable
= 'S';
244 /** @alias ion\Symbol\Enum::toSymbol */
245 public function toSymbol() : \ion\Symbol
{}
246 /** @alias ion\Symbol\Enum::toSID */
247 public function toSID() : int {}
248 /** @alias ion\Symbol\Enum::toString */
249 public function toString() : string {}
252 class Local
implements \ion\Symbol\Table
{
253 /** Internal cache */
254 private array $imports = [];
255 /** Internal cache */
256 private array $symbols = [];
258 public function __construct() {}
259 public function import(\ion\Symbol\Table
$table) : void
{}
261 /** @alias ion\Symbol\Table::getMaxId */
262 public function getMaxId() : int {}
264 /** @alias ion\Symbol\Table::add */
265 public function add(\ion\Symbol|
string $symbol) : int {}
266 /** @alias ion\Symbol\Table::find */
267 public function find(string|
int $id) : ?\ion\Symbol
{}
268 /** @alias ion\Symbol\Table::findLocal */
269 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
272 class Shared
implements \ion\Symbol\Table
{
273 public function __construct(
274 public readonly
string $name,
275 public readonly
int $version = 1,
276 ?
array $symbols = null,
279 /** Internal cache */
280 private array $symbols = [];
282 /** @alias ion\Symbol\Table::getMaxId */
283 public function getMaxId() : int {}
285 /** @alias ion\Symbol\Table::add */
286 public function add(\ion\Symbol|
string $symbol) : int {}
287 /** @alias ion\Symbol\Table::find */
288 public function find(string|
int $id) : ?\ion\Symbol
{}
289 /** @alias ion\Symbol\Table::findLocal */
290 public function findLocal(string|
int $id) : ?\ion\Symbol
{}
293 namespace ion\Decimal
;
296 public function __construct(
297 public readonly
int $digits,
298 public readonly
int $eMax,
299 public readonly
int $eMin,
300 public readonly Context\Rounding|
int $round,
301 public readonly
bool $clamp,
304 public static function Dec32() : Context
{}
305 public static function Dec64() : Context
{}
306 public static function Dec128() : Context
{}
307 public static function DecMax(Context\Rounding|
int $round = Context\Rounding
::HalfEven
) : Context
{}
310 namespace ion\Decimal\Context
;
312 enum Rounding
: int {
323 namespace ion\Timestamp
;
325 enum Precision
: int {
327 case Month
= 0x1|
0x2;
328 case Day
= 0x1|
0x2|
0x4;
329 case Min
= 0x1|
0x2|
0x4|
0x10;
330 case Sec
= 0x1|
0x2|
0x4|
0x10|
0x20;
331 case Frac
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40;
332 case MinTZ
= 0x1|
0x2|
0x4|
0x10|
0x80;
333 case SecTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x80;
334 case FracTZ
= 0x1|
0x2|
0x4|
0x10|
0x20|
0x40|
0x80;
337 enum Format
: string {
339 case Month
= "Y-m\T";
340 case Day
= "Y-m-d\T";
341 case Min
= "Y-m-d\TH:i";
342 case Sec
= "Y-m-d\TH:i:s";
343 case Frac
= "Y-m-d\TH:i:s.v";
344 case MinTZ
= "Y-m-d\TH:iP";
345 case SecTZ
= "Y-m-d\TH:i:sP";
346 case FracTZ
= "Y-m-d\TH:i:s.vP";
349 namespace ion\Reader
;
352 public function __construct(
353 public readonly ?\ion\Catalog
$catalog = null,
354 public readonly ?\ion\Decimal\Context
$decimalContext = null,
355 public readonly ?\Closure
$onContextChange = null,
356 public readonly
bool $returnSystemValues = false,
357 public readonly
int $newLine = 0xa,
358 public readonly
int $maxContainerDepth = 10,
359 public readonly
int $maxAnnotations = 10,
360 public readonly
int $maxAnnotationBuffered = 512,
361 public readonly
int $symbolThreshold = 0x4000,
362 public readonly
int $userValueThreshold = 0x4000,
363 public readonly
int $chunkThreshold = 0x4000,
364 public readonly
int $allocationPageSize = 0x10000,
365 public readonly
bool $skipCharacterValidation = false,
369 abstract class Reader
implements \ion\Reader
{
370 public readonly ?Options
$options;
372 public function hasChildren() : bool {}
373 public function getChildren() : \ion\Reader
{}
375 public function rewind() : void
{}
376 public function next() : void
{}
377 public function valid() : bool {}
378 public function key() : mixed {}
379 public function current() : mixed {}
381 public function getType() : \ion\Type
{}
382 public function hasAnnotations() : bool {}
383 public function hasAnnotation(string $annotation) : bool {}
384 public function isNull() : bool {}
385 public function isInStruct() : bool {}
386 public function getFieldName() : string {}
387 public function getFieldNameSymbol() : \ion\Symbol
{}
388 public function getAnnotations() : array {}
389 public function getAnnotationSymbols() : array {}
390 public function countAnnotations() : int {}
391 public function getAnnotation(int $index) : string {}
392 public function getAnnotationSymbol(int $index) : \ion\Symbol
{}
394 public function readNull() : \ion\Type
{}
395 public function readBool() : bool {}
396 public function readInt() : int|
string {}
397 public function readFloat() : float {}
398 public function readDecimal() : \ion\Decimal
{}
399 public function readTimestamp() : \ion\Timestamp
{}
400 public function readSymbol() : \ion\Symbol
{}
401 public function readString() : string {}
402 /** @param ref $string */
403 public function readStringPart(&$string, int $length = 0x1000) : bool {}
404 public function readLob() : string {}
405 /** @param ref $string */
406 public function readLobPart(&$string, int $length = 0x1000) : bool {}
408 public function getPosition() : int {}
409 public function getDepth() : int{}
411 public function seek(int $offset, int $length = -1) : void
{}
413 public function getSymbolTable() : SymbolTable {}
414 public function setSymbolTable(SymbolTable $table) : void {}
416 public function getValueOffset() : int {}
417 public function getValueLength() : int {}
420 interface Buffer
extends \ion\Reader
{
421 public function getBuffer() : string;
424 interface Stream
extends \ion\Reader
{
425 /** @return resource */
426 public function getStream();
427 /** @param resource $stream */
428 public function resetStream($stream) : void
;
429 /** @param resource $stream */
430 public function resetStreamWithLength($stream, int $length) : void
;
433 namespace ion\Reader\Buffer
;
435 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Buffer
{
436 public function __construct(
438 ?\ion\Reader\Options
$options = null,
441 public function getBuffer() : string {}
444 namespace ion\Reader\Stream
;
446 class Reader
extends \ion\Reader\Reader
implements \ion\Reader\Stream
{
447 /** @param resource $stream */
448 public function __construct(
450 ?\ion\Reader\Options
$options = null,
453 /** @return resource */
454 public function getStream() {}
455 /** @param resource $stream */
456 public function resetStream($stream) : void
{}
457 /** @param resource $stream */
458 public function resetStreamWithLength($stream, int $length) : void
{}
461 namespace ion\Writer
;
464 public function __construct(
465 public readonly ?\ion\Catalog
$catalog = null,
466 public readonly ?\ion\Decimal\Context
$decimalContext = null,
467 public readonly
bool $outputBinary = false,
468 public readonly
bool $compactFloats = false,
469 public readonly
bool $escapeNonAscii = false,
470 public readonly
bool $prettyPrint = false,
471 public readonly
bool $indentTabs = true,
472 public readonly
int $indentSize = 2,
473 public readonly
bool $smallContainersInline = true,
474 public readonly
bool $suppressSystemValues = false,
475 public readonly
bool $flushEveryValue = false,
476 public readonly
int $maxContainerDepth = 10,
477 public readonly
int $maxAnnotations = 10,
478 public readonly
int $tempBufferSize = 0x4000,
479 public readonly
int $allocationPageSize = 0x10000,
483 abstract class Writer
implements \ion\Writer
{
484 public function writeNull() : void
{}
485 public function writeTypedNull(\ion\Type
$type) : void
{}
486 public function writeBool(bool $value) : void
{}
487 public function writeInt(int|
string $value) : void
{}
488 public function writeFloat(float $value) : void
{}
489 public function writeDecimal(\ion\Decimal|
string $value) : void
{}
490 public function writeTimestamp(\ion\Timestamp|
string $value) : void
{}
491 public function writeSymbol(\ion\Symbol|
string $value) : void
{}
492 public function writeString(string $value) : void
{}
493 public function writeCLob(string $value) : void
{}
494 public function writeBLob(string $value) : void
{}
496 public function startLob(\ion\Type
$type) : void
{}
497 public function appendLob(string $data) : void
{}
498 public function finishLob() : void
{}
500 public function startContainer(\ion\Type
$type) : void
{}
501 public function finishContainer() : void
{}
503 public function writeFieldName(string $name) : void
{}
505 public function writeAnnotation(\ion\Symbol|
string ...$annotation) : void
{}
507 public function getDepth() : int {}
508 public function flush() : int {}
509 public function finish() : int {}
511 // public function writeOne(\ion\Reader $reader) : void {}
512 // public function writeAll(\ion\Reader $reader) : void {}
515 interface Buffer
extends \ion\Writer
{
516 public function getBuffer() : string;
517 public function resetBuffer() : void
;
520 interface Stream
extends \ion\Writer
{
521 /** @return resource */
522 public function getStream();
525 namespace ion\Writer\Buffer
;
527 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Buffer
{
528 public function __construct(
529 ?\ion\Writer\Options
$options = null,
532 public function getBuffer() : string {}
533 public function resetBuffer() : void
{}
536 namespace ion\Writer\Stream
;
538 class Writer
extends \ion\Writer\Writer
implements \ion\Writer\Stream
{
539 /** @param resource $stream */
540 public function __construct(
542 ?\ion\Writer\Options
$options = null,
544 /** @return resource */
545 public function getStream() {}
548 namespace ion\Serializer
;
550 class PHP
implements \ion\Serializer
{
551 public function __construct(
552 public readonly ?\ion\Writer\Options
$writerOptions = null,
553 public readonly
bool $multiSequence = false,
554 public readonly
bool $callMagicSerialize = true,
555 public readonly ?
string $callCustomSerialize = null,
557 public function serialize(mixed $data) : string {}
560 namespace ion\Unserializer
;
562 class PHP
implements \ion\Unserializer
{
563 public function __construct(
564 public readonly ?\ion\Reader\Options
$readerOptions = null,
565 public readonly
bool $multiSequence = false,
566 public readonly
bool $callMagicUnserialize = true,
567 public readonly ?
string $callCustomUnserialize = null,
569 /** @param string|resource $data */
570 public function unserialize($data) : mixed {}