From: Michael Wallner
Date: Tue, 25 Jan 2022 12:00:12 +0000 (+0100)
Subject: move PHP and System table enums to the Symbol ns
X-Git-Tag: v0.1.0~5
X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=b372aaf7f0eeabb9d0e73d142039d5c062ca59c7;p=awesomized%2Fext-ion
move PHP and System table enums to the Symbol ns
---
diff --git a/.gitignore b/.gitignore
index 03be6a7..a4e2e2b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,3 +49,4 @@ tmp-php.ini
docs/vendor
docs/src
docs/composer.*
+*.tgz
diff --git a/README.md b/README.md
index 66e6d4e..905b958 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ sudo make install # INSTALL=install
### Try with Docker:
```shell
docker build -t php-ion
-docker run --rm php-ion -r 'echo ion\serialize(ion\Symbol\Table\PHP());'
+docker run --rm php-ion -r 'echo ion\serialize(ion\Symbol\PHP::asTable());'
```
## Editor Stub:
diff --git a/docs/v0.0/index.html b/docs/v0.0/index.html
index 424b29e..1f893ff 100644
--- a/docs/v0.0/index.html
+++ b/docs/v0.0/index.html
@@ -52,7 +52,7 @@ See the Amazon ION specification .
ion.stub.php
Last modified:
- 2022-01-20 17:13:57 UTC
+ 2022-01-25 11:49:44 UTC
diff --git a/docs/v0.0/ion.html b/docs/v0.0/ion.html
index 810dedc..d8059b4 100644
--- a/docs/v0.0/ion.html
+++ b/docs/v0.0/ion.html
@@ -150,19 +150,19 @@
↳ ImportLocation
+ ↳ PHP
+
+
+ ↳ System
+
+
↳ Table
@@ -315,7 +315,7 @@ instances of the following PHP classes cannot be cloned:
ion.stub.php
Last modified:
- 2022-01-20 17:13:57 UTC
+ 2022-01-25 11:49:44 UTC
diff --git a/docs/v0.0/ion.stub.php b/docs/v0.0/ion.stub.php
index 15b60d3..5e389b4 100644
--- a/docs/v0.0/ion.stub.php
+++ b/docs/v0.0/ion.stub.php
@@ -447,24 +447,6 @@ interface Table {
public function findLocal(string|int $id) : ?\ion\Symbol;
}
-namespace ion\Symbol\Table;
-
-/**
- * Get the built-in PHP shared symbol table.
- *
- * @see \ion\Symbol\Table\PHP
- * @return \ion\Symbol\Table The builtin PHP shared symbol table.
- */
-function PHP() : \ion\Symbol\Table {}
-
-/**
- * Get the built-in ION system shared symbol table.
- *
- * @see \ion\Symbol\Table\System
- * @return \ion\Symbol\Table The builtin ION system shared symbol table.
- */
-function System() : \ion\Symbol\Table {}
-
/**
* The built-in ION system symbols.
*/
@@ -485,6 +467,13 @@ enum System : string implements \ion\Symbol\Enum {
public function toSID() : int {}
/** @alias ion\Symbol\Enum::toString */
public function toString() : string {}
+
+ /**
+ * Get the built-in ION system shared symbol table.
+ *
+ * @return Table\Shared The system symbol table.
+ */
+ public static function asTable() : Table\Shared {}
}
/**
@@ -508,8 +497,17 @@ enum PHP : string implements \ion\Symbol\Enum {
public function toSID() : int {}
/** @alias ion\Symbol\Enum::toString */
public function toString() : string {}
+
+ /**
+ * Get the built-in PHP shared symbol table.
+ *
+ * @return Table\Shared The builtin PHP shared symbol table.
+ */
+ public static function asTable() : Table\Shared {}
}
+namespace ion\Symbol\Table;
+
/**
* A local symbol table.
*
diff --git a/docs/v0.0/ion/Symbol.html b/docs/v0.0/ion/Symbol.html
index 18bfc3c..b4166fe 100644
--- a/docs/v0.0/ion/Symbol.html
+++ b/docs/v0.0/ion/Symbol.html
@@ -52,6 +52,16 @@
+
+ ↳ PHP
+
+
+
+
+ ↳ System
+
+
+
↳ Table
@@ -60,13 +70,7 @@
↳ Local
- ↳ PHP
-
-
↳ Shared
-
-
- ↳ System
@@ -187,6 +191,20 @@ The import location referencing a shared symbol table.
class ion\Symbol\ImportLocation
+
+
+ The built-in PHP symbols.
+
+ enum ion\Symbol\PHP implements BackedEnum, UnitEnum, ion\Symbol\Enum
+
+
+
+
+ The built-in ION system symbols.
+
+ enum ion\Symbol\System implements BackedEnum, UnitEnum, ion\Symbol\Enum
+
+
Base interface of an ION symbol table.
diff --git a/docs/v0.0/ion/Symbol/Enum.html b/docs/v0.0/ion/Symbol/Enum.html
index df85adb..151a679 100644
--- a/docs/v0.0/ion/Symbol/Enum.html
+++ b/docs/v0.0/ion/Symbol/Enum.html
@@ -70,6 +70,10 @@
↲ ImportLocation
+ ↲ PHP
+
+ ↲ System
+
↲ Table
↲ Symbol::__construct
diff --git a/docs/v0.0/ion/Symbol/ImportLocation.html b/docs/v0.0/ion/Symbol/ImportLocation.html
index b231f78..bcf89d8 100644
--- a/docs/v0.0/ion/Symbol/ImportLocation.html
+++ b/docs/v0.0/ion/Symbol/ImportLocation.html
@@ -60,6 +60,10 @@
↲ Enum
+ ↲ PHP
+
+ ↲ System
+
↲ Table
↲ Symbol::__construct
diff --git a/docs/v0.0/ion/Symbol/PHP.html b/docs/v0.0/ion/Symbol/PHP.html
new file mode 100644
index 0000000..90c59de
--- /dev/null
+++ b/docs/v0.0/ion/Symbol/PHP.html
@@ -0,0 +1,164 @@
+
+
+
+
+
+ PHP -
+ mdref
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
enum ion\Symbol\PHP implements BackedEnum, UnitEnum, ion\Symbol\Enum
+
The built-in PHP symbols.
+
Constants:#
+
+
+PHP = 'PHP'
+
+
+Reference = 'R'
+
+
+Backref = 'r'
+
+
+Property = 'p'
+
+
+Object = 'o'
+
+
+ClassObject = 'c'
+
+
+MagicObject = 'O'
+
+
+CustomObject = 'C'
+
+
+Enum = 'E'
+
+
+Serializable = 'S'
+
+
+
Properties:#
+
+public string $name
+The built-in PHP symbols.
+public string $value
+The built-in PHP symbols.
+
+
+
+
+
Functions:
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/v0.0/ion/Symbol/PHP/asTable.html b/docs/v0.0/ion/Symbol/PHP/asTable.html
new file mode 100644
index 0000000..61a324f
--- /dev/null
+++ b/docs/v0.0/ion/Symbol/PHP/asTable.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+ PHP::asTable -
+ mdref
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
static ion\Symbol\Table\Shared ion\Symbol\PHP::asTable()
+
Get the built-in PHP shared symbol table.
+
Params:#
+
None.
+
Returns:#
+
+\Table\Shared, The builtin PHP shared symbol table.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/v0.0/ion/Symbol/System.html b/docs/v0.0/ion/Symbol/System.html
new file mode 100644
index 0000000..0adbc79
--- /dev/null
+++ b/docs/v0.0/ion/Symbol/System.html
@@ -0,0 +1,161 @@
+
+
+
+
+
+ System -
+ mdref
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
enum ion\Symbol\System implements BackedEnum, UnitEnum, ion\Symbol\Enum
+
The built-in ION system symbols.
+
Constants:#
+
+
+Ion = '$ion'
+
+
+Ivm_1_0 = '$ion_1_0'
+
+
+IonSymbolTable = '$ion_symbol_table'
+
+
+Name = 'name'
+
+
+Version = 'version'
+
+
+Imports = 'imports'
+
+
+Symbols = 'symbols'
+
+
+MaxId = 'max_id'
+
+
+SharedSymbolTable = '$ion_shared_symbol_table'
+
+
+
Properties:#
+
+public string $name
+The built-in ION system symbols.
+public string $value
+The built-in ION system symbols.
+
+
+
+
+
Functions:
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/v0.0/ion/Symbol/System/asTable.html b/docs/v0.0/ion/Symbol/System/asTable.html
new file mode 100644
index 0000000..bfa2cfd
--- /dev/null
+++ b/docs/v0.0/ion/Symbol/System/asTable.html
@@ -0,0 +1,105 @@
+
+
+
+
+
+ System::asTable -
+ mdref
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
static ion\Symbol\Table\Shared ion\Symbol\System::asTable()
+
Get the built-in ION system shared symbol table.
+
Params:#
+
None.
+
Returns:#
+
+\Table\Shared, The system symbol table.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/v0.0/ion/Symbol/Table.html b/docs/v0.0/ion/Symbol/Table.html
index a043f90..db2c951 100644
--- a/docs/v0.0/ion/Symbol/Table.html
+++ b/docs/v0.0/ion/Symbol/Table.html
@@ -53,21 +53,11 @@
-
- ↳ PHP
-
-
-
↳ Shared
-
- ↳ System
-
-
-
↳ Table::add
@@ -96,6 +86,10 @@
↲ Enum
↲ ImportLocation
+
+ ↲ PHP
+
+ ↲ System
↲ Symbol::__construct
@@ -165,13 +159,6 @@
class ion\Symbol\Table\Local implements ion\Symbol\Table
-
-
- The built-in PHP symbols.
-
- enum ion\Symbol\Table\PHP implements BackedEnum, UnitEnum, ion\Symbol\Enum
-
-
A shared symbol table.
@@ -179,13 +166,6 @@
class ion\Symbol\Table\Shared implements ion\Symbol\Table
-
-
- The built-in ION system symbols.
-
- enum ion\Symbol\Table\System implements BackedEnum, UnitEnum, ion\Symbol\Enum
-
-
diff --git a/docs/v0.0/ion/Symbol/Table/Local.html b/docs/v0.0/ion/Symbol/Table/Local.html
index 50b261f..56634c6 100644
--- a/docs/v0.0/ion/Symbol/Table/Local.html
+++ b/docs/v0.0/ion/Symbol/Table/Local.html
@@ -69,12 +69,8 @@
- ↲ PHP
-
↲ Shared
- ↲ System
-
↲ Table::add
↲ Table::find
diff --git a/docs/v0.0/ion/Symbol/Table/PHP.html b/docs/v0.0/ion/Symbol/Table/PHP.html
deleted file mode 100644
index 7373e3b..0000000
--- a/docs/v0.0/ion/Symbol/Table/PHP.html
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
- PHP -
- mdref
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
enum ion\Symbol\Table\PHP implements BackedEnum, UnitEnum, ion\Symbol\Enum
-
The built-in PHP symbols.
-
Constants:#
-
-
-PHP = 'PHP'
-
-
-Reference = 'R'
-
-
-Backref = 'r'
-
-
-Property = 'p'
-
-
-Object = 'o'
-
-
-ClassObject = 'c'
-
-
-MagicObject = 'O'
-
-
-CustomObject = 'C'
-
-
-Enum = 'E'
-
-
-Serializable = 'S'
-
-
-
Properties:#
-
-public string $name
-The built-in PHP symbols.
-public string $value
-The built-in PHP symbols.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/v0.0/ion/Symbol/Table/Shared.html b/docs/v0.0/ion/Symbol/Table/Shared.html
index 7d72429..bb3b7d4 100644
--- a/docs/v0.0/ion/Symbol/Table/Shared.html
+++ b/docs/v0.0/ion/Symbol/Table/Shared.html
@@ -65,11 +65,7 @@
↲ Local
-
- ↲ PHP
- ↲ System
-
↲ Table::add
↲ Table::find
diff --git a/docs/v0.0/ion/Symbol/Table/System.html b/docs/v0.0/ion/Symbol/Table/System.html
deleted file mode 100644
index 71e8e54..0000000
--- a/docs/v0.0/ion/Symbol/Table/System.html
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
- System -
- mdref
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
enum ion\Symbol\Table\System implements BackedEnum, UnitEnum, ion\Symbol\Enum
-
The built-in ION system symbols.
-
Constants:#
-
-
-Ion = '$ion'
-
-
-Ivm_1_0 = '$ion_1_0'
-
-
-IonSymbolTable = '$ion_symbol_table'
-
-
-Name = 'name'
-
-
-Version = 'version'
-
-
-Imports = 'imports'
-
-
-Symbols = 'symbols'
-
-
-MaxId = 'max_id'
-
-
-SharedSymbolTable = '$ion_shared_symbol_table'
-
-
-
Properties:#
-
-public string $name
-The built-in ION system symbols.
-public string $value
-The built-in ION system symbols.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/v0.0/ion/Symbol/Table/add.html b/docs/v0.0/ion/Symbol/Table/add.html
index ef50e1d..8e73a66 100644
--- a/docs/v0.0/ion/Symbol/Table/add.html
+++ b/docs/v0.0/ion/Symbol/Table/add.html
@@ -57,11 +57,7 @@
↲ Local
- ↲ PHP
-
↲ Shared
-
- ↲ System
↲ Table::find
diff --git a/docs/v0.0/ion/Symbol/Table/find.html b/docs/v0.0/ion/Symbol/Table/find.html
index 03d64c7..f74440d 100644
--- a/docs/v0.0/ion/Symbol/Table/find.html
+++ b/docs/v0.0/ion/Symbol/Table/find.html
@@ -57,12 +57,8 @@
↲ Local
- ↲ PHP
-
↲ Shared
- ↲ System
-
↲ Table::add
↲ Table::findLocal
diff --git a/docs/v0.0/ion/Symbol/Table/findLocal.html b/docs/v0.0/ion/Symbol/Table/findLocal.html
index e4afe91..8706502 100644
--- a/docs/v0.0/ion/Symbol/Table/findLocal.html
+++ b/docs/v0.0/ion/Symbol/Table/findLocal.html
@@ -57,12 +57,8 @@
↲ Local
- ↲ PHP
-
↲ Shared
- ↲ System
-
↲ Table::add
↲ Table::find
diff --git a/docs/v0.0/ion/Symbol/Table/getMaxId.html b/docs/v0.0/ion/Symbol/Table/getMaxId.html
index 0c1e5cd..69f2a28 100644
--- a/docs/v0.0/ion/Symbol/Table/getMaxId.html
+++ b/docs/v0.0/ion/Symbol/Table/getMaxId.html
@@ -57,12 +57,8 @@
↲ Local
- ↲ PHP
-
↲ Shared
- ↲ System
-
↲ Table::add
↲ Table::find
diff --git a/docs/v0.0/ion/Symbol/__construct.html b/docs/v0.0/ion/Symbol/__construct.html
index a505d94..20f4d4d 100644
--- a/docs/v0.0/ion/Symbol/__construct.html
+++ b/docs/v0.0/ion/Symbol/__construct.html
@@ -53,6 +53,10 @@
↲ ImportLocation
+ ↲ PHP
+
+ ↲ System
+
↲ Table
↲ Symbol::equals
diff --git a/docs/v0.0/ion/Symbol/equals.html b/docs/v0.0/ion/Symbol/equals.html
index 426d216..6685ec1 100644
--- a/docs/v0.0/ion/Symbol/equals.html
+++ b/docs/v0.0/ion/Symbol/equals.html
@@ -53,6 +53,10 @@
↲ ImportLocation
+ ↲ PHP
+
+ ↲ System
+
↲ Table
↲ Symbol::__construct
diff --git a/docs/v0.0/ion/Symbol/toString.html b/docs/v0.0/ion/Symbol/toString.html
index f82e923..14da3ef 100644
--- a/docs/v0.0/ion/Symbol/toString.html
+++ b/docs/v0.0/ion/Symbol/toString.html
@@ -53,6 +53,10 @@
↲ ImportLocation
+ ↲ PHP
+
+ ↲ System
+
↲ Table
↲ Symbol::__construct
diff --git a/ion.c b/ion.c
index d2675f0..cffeee5 100644
--- a/ion.c
+++ b/ion.c
@@ -125,7 +125,7 @@ static ZEND_METHOD(ion_Symbol_Enum, toString)
zval tmp;
RETVAL_ZVAL(zend_read_property(Z_OBJCE_P(zsym), Z_OBJ_P(zsym), ZEND_STRL("value"), 0, &tmp), 1, 0);
}
-static ZEND_FUNCTION(ion_Symbol_Table_System)
+static ZEND_METHOD(ion_Symbol_System, asTable)
{
ZEND_PARSE_PARAMETERS_NONE();
@@ -135,7 +135,7 @@ static ZEND_FUNCTION(ion_Symbol_Table_System)
php_ion_symbol_table_ctor(obj);
ion_symbol_table_lock(obj->tab);
}
-static ZEND_FUNCTION(ion_Symbol_Table_PHP)
+static ZEND_METHOD(ion_Symbol_PHP, asTable)
{
ZEND_PARSE_PARAMETERS_NONE();
@@ -1802,8 +1802,8 @@ PHP_MINIT_FUNCTION(ion)
ce_Symbol_Table_Shared = register_class_ion_Symbol_Table_Shared(ce_Symbol_Table);
ce_Symbol_Table_Shared->create_object = create_ion_Symbol_Table;
ce_Symbol_Enum = register_class_ion_Symbol_Enum();
- ce_Symbol_Table_System = register_class_ion_Symbol_Table_System(ce_Symbol_Enum);
- ce_Symbol_Table_PHP = register_class_ion_Symbol_Table_PHP(ce_Symbol_Enum);
+ ce_Symbol_Table_System = register_class_ion_Symbol_System(ce_Symbol_Enum);
+ ce_Symbol_Table_PHP = register_class_ion_Symbol_PHP(ce_Symbol_Enum);
// Timestamp
ce_Timestamp = register_class_ion_Timestamp(php_date_get_date_ce());
diff --git a/ion.stub.php b/ion.stub.php
index 15b60d3..5e389b4 100644
--- a/ion.stub.php
+++ b/ion.stub.php
@@ -447,24 +447,6 @@ interface Table {
public function findLocal(string|int $id) : ?\ion\Symbol;
}
-namespace ion\Symbol\Table;
-
-/**
- * Get the built-in PHP shared symbol table.
- *
- * @see \ion\Symbol\Table\PHP
- * @return \ion\Symbol\Table The builtin PHP shared symbol table.
- */
-function PHP() : \ion\Symbol\Table {}
-
-/**
- * Get the built-in ION system shared symbol table.
- *
- * @see \ion\Symbol\Table\System
- * @return \ion\Symbol\Table The builtin ION system shared symbol table.
- */
-function System() : \ion\Symbol\Table {}
-
/**
* The built-in ION system symbols.
*/
@@ -485,6 +467,13 @@ enum System : string implements \ion\Symbol\Enum {
public function toSID() : int {}
/** @alias ion\Symbol\Enum::toString */
public function toString() : string {}
+
+ /**
+ * Get the built-in ION system shared symbol table.
+ *
+ * @return Table\Shared The system symbol table.
+ */
+ public static function asTable() : Table\Shared {}
}
/**
@@ -508,8 +497,17 @@ enum PHP : string implements \ion\Symbol\Enum {
public function toSID() : int {}
/** @alias ion\Symbol\Enum::toString */
public function toString() : string {}
+
+ /**
+ * Get the built-in PHP shared symbol table.
+ *
+ * @return Table\Shared The builtin PHP shared symbol table.
+ */
+ public static function asTable() : Table\Shared {}
}
+namespace ion\Symbol\Table;
+
/**
* A local symbol table.
*
diff --git a/ion_arginfo.h b/ion_arginfo.h
index 900715d..a06aedb 100644
--- a/ion_arginfo.h
+++ b/ion_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6dcf67bb6d8b532d66b378544582f68e2508b7b2 */
+ * Stub hash: 82f37b032b109ad08cffc965a75843e57210debf */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ion_serialize, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0)
@@ -11,11 +11,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ion_unserialize, 0, 1, IS_MIXED,
ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, unserializer, ion\\Unserializer, 1, "null")
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_ion_Symbol_Table_PHP, 0, 0, ion\\Symbol\\Table, 0)
-ZEND_END_ARG_INFO()
-
-#define arginfo_ion_Symbol_Table_System arginfo_ion_Symbol_Table_PHP
-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ion_Serializer_serialize, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0)
ZEND_END_ARG_INFO()
@@ -255,17 +250,22 @@ ZEND_END_ARG_INFO()
#define arginfo_class_ion_Symbol_Table_findLocal arginfo_class_ion_Symbol_Table_find
-#define arginfo_class_ion_Symbol_Table_System_toSymbol arginfo_class_ion_Reader_getFieldNameSymbol
+#define arginfo_class_ion_Symbol_System_toSymbol arginfo_class_ion_Reader_getFieldNameSymbol
-#define arginfo_class_ion_Symbol_Table_System_toSID arginfo_class_ion_Catalog_count
+#define arginfo_class_ion_Symbol_System_toSID arginfo_class_ion_Catalog_count
+
+#define arginfo_class_ion_Symbol_System_toString arginfo_class_ion_Symbol___toString
+
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ion_Symbol_System_asTable, 0, 0, ion\\Symbol\\Table\\Shared, 0)
+ZEND_END_ARG_INFO()
-#define arginfo_class_ion_Symbol_Table_System_toString arginfo_class_ion_Symbol___toString
+#define arginfo_class_ion_Symbol_PHP_toSymbol arginfo_class_ion_Reader_getFieldNameSymbol
-#define arginfo_class_ion_Symbol_Table_PHP_toSymbol arginfo_class_ion_Reader_getFieldNameSymbol
+#define arginfo_class_ion_Symbol_PHP_toSID arginfo_class_ion_Catalog_count
-#define arginfo_class_ion_Symbol_Table_PHP_toSID arginfo_class_ion_Catalog_count
+#define arginfo_class_ion_Symbol_PHP_toString arginfo_class_ion_Symbol___toString
-#define arginfo_class_ion_Symbol_Table_PHP_toString arginfo_class_ion_Symbol___toString
+#define arginfo_class_ion_Symbol_PHP_asTable arginfo_class_ion_Symbol_System_asTable
#define arginfo_class_ion_Symbol_Table_Local___construct arginfo_class_ion_Catalog___construct
@@ -526,8 +526,6 @@ ZEND_END_ARG_INFO()
static ZEND_FUNCTION(ion_serialize);
static ZEND_FUNCTION(ion_unserialize);
-static ZEND_FUNCTION(ion_Symbol_Table_PHP);
-static ZEND_FUNCTION(ion_Symbol_Table_System);
static ZEND_METHOD(ion_Symbol, __construct);
static ZEND_METHOD(ion_Symbol, equals);
static ZEND_METHOD(ion_Symbol, __toString);
@@ -546,6 +544,8 @@ static ZEND_METHOD(ion_Decimal, toInt);
static ZEND_METHOD(ion_Timestamp, __construct);
static ZEND_METHOD(ion_Timestamp, __toString);
static ZEND_METHOD(ion_Symbol_ImportLocation, __construct);
+static ZEND_METHOD(ion_Symbol_System, asTable);
+static ZEND_METHOD(ion_Symbol_PHP, asTable);
static ZEND_METHOD(ion_Symbol_Table_Local, __construct);
static ZEND_METHOD(ion_Symbol_Table_Local, import);
static ZEND_METHOD(ion_Symbol_Table_Shared, __construct);
@@ -632,8 +632,6 @@ static ZEND_METHOD(ion_Unserializer_PHP, unserialize);
static const zend_function_entry ext_functions[] = {
ZEND_NS_RAW_FENTRY("ion", "serialize", ZEND_FN(ion_serialize), arginfo_ion_serialize, 0)
ZEND_NS_RAW_FENTRY("ion", "unserialize", ZEND_FN(ion_unserialize), arginfo_ion_unserialize, 0)
- ZEND_NS_RAW_FENTRY("ion\\Symbol\\Table", "PHP", ZEND_FN(ion_Symbol_Table_PHP), arginfo_ion_Symbol_Table_PHP, 0)
- ZEND_NS_RAW_FENTRY("ion\\Symbol\\Table", "System", ZEND_FN(ion_Symbol_Table_System), arginfo_ion_Symbol_Table_System, 0)
ZEND_FE_END
};
@@ -786,18 +784,20 @@ static const zend_function_entry class_ion_Symbol_Table_methods[] = {
};
-static const zend_function_entry class_ion_Symbol_Table_System_methods[] = {
- ZEND_MALIAS(ion_Symbol_Enum, toSymbol, toSymbol, arginfo_class_ion_Symbol_Table_System_toSymbol, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(ion_Symbol_Enum, toSID, toSID, arginfo_class_ion_Symbol_Table_System_toSID, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(ion_Symbol_Enum, toString, toString, arginfo_class_ion_Symbol_Table_System_toString, ZEND_ACC_PUBLIC)
+static const zend_function_entry class_ion_Symbol_System_methods[] = {
+ ZEND_MALIAS(ion_Symbol_Enum, toSymbol, toSymbol, arginfo_class_ion_Symbol_System_toSymbol, ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(ion_Symbol_Enum, toSID, toSID, arginfo_class_ion_Symbol_System_toSID, ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(ion_Symbol_Enum, toString, toString, arginfo_class_ion_Symbol_System_toString, ZEND_ACC_PUBLIC)
+ ZEND_ME(ion_Symbol_System, asTable, arginfo_class_ion_Symbol_System_asTable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
ZEND_FE_END
};
-static const zend_function_entry class_ion_Symbol_Table_PHP_methods[] = {
- ZEND_MALIAS(ion_Symbol_Enum, toSymbol, toSymbol, arginfo_class_ion_Symbol_Table_PHP_toSymbol, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(ion_Symbol_Enum, toSID, toSID, arginfo_class_ion_Symbol_Table_PHP_toSID, ZEND_ACC_PUBLIC)
- ZEND_MALIAS(ion_Symbol_Enum, toString, toString, arginfo_class_ion_Symbol_Table_PHP_toString, ZEND_ACC_PUBLIC)
+static const zend_function_entry class_ion_Symbol_PHP_methods[] = {
+ ZEND_MALIAS(ion_Symbol_Enum, toSymbol, toSymbol, arginfo_class_ion_Symbol_PHP_toSymbol, ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(ion_Symbol_Enum, toSID, toSID, arginfo_class_ion_Symbol_PHP_toSID, ZEND_ACC_PUBLIC)
+ ZEND_MALIAS(ion_Symbol_Enum, toString, toString, arginfo_class_ion_Symbol_PHP_toString, ZEND_ACC_PUBLIC)
+ ZEND_ME(ion_Symbol_PHP, asTable, arginfo_class_ion_Symbol_PHP_asTable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
ZEND_FE_END
};
@@ -1275,9 +1275,9 @@ static zend_class_entry *register_class_ion_Symbol_Table(void)
return class_entry;
}
-static zend_class_entry *register_class_ion_Symbol_Table_System(zend_class_entry *class_entry_ion_Symbol_Enum)
+static zend_class_entry *register_class_ion_Symbol_System(zend_class_entry *class_entry_ion_Symbol_Enum)
{
- zend_class_entry *class_entry = zend_register_internal_enum("ion\\Symbol\\Table\\System", IS_STRING, class_ion_Symbol_Table_System_methods);
+ zend_class_entry *class_entry = zend_register_internal_enum("ion\\Symbol\\System", IS_STRING, class_ion_Symbol_System_methods);
zend_class_implements(class_entry, 1, class_entry_ion_Symbol_Enum);
zval enum_case_Ion_value;
@@ -1328,9 +1328,9 @@ static zend_class_entry *register_class_ion_Symbol_Table_System(zend_class_entry
return class_entry;
}
-static zend_class_entry *register_class_ion_Symbol_Table_PHP(zend_class_entry *class_entry_ion_Symbol_Enum)
+static zend_class_entry *register_class_ion_Symbol_PHP(zend_class_entry *class_entry_ion_Symbol_Enum)
{
- zend_class_entry *class_entry = zend_register_internal_enum("ion\\Symbol\\Table\\PHP", IS_STRING, class_ion_Symbol_Table_PHP_methods);
+ zend_class_entry *class_entry = zend_register_internal_enum("ion\\Symbol\\PHP", IS_STRING, class_ion_Symbol_PHP_methods);
zend_class_implements(class_entry, 1, class_entry_ion_Symbol_Enum);
zval enum_case_PHP_value;
diff --git a/tests/Catalog.phpt b/tests/Catalog.phpt
index a30db7e..2901da7 100644
--- a/tests/Catalog.phpt
+++ b/tests/Catalog.phpt
@@ -8,7 +8,7 @@ TEST
$c = new ion\Catalog;
var_dump(count($c));
-$c->add($php = ion\Symbol\Table\PHP());
+$c->add($php = ion\Symbol\PHP::asTable());
var_dump(count($c));
$c->add(new ion\Symbol\Table\Shared("shared", 1, ["foo", "bar", "baz"]));
var_dump(count($c));
diff --git a/tests/Symbol/Enum.phpt b/tests/Symbol/Enum.phpt
index 2478b0f..a9e42d6 100644
--- a/tests/Symbol/Enum.phpt
+++ b/tests/Symbol/Enum.phpt
@@ -5,7 +5,7 @@ ion
--FILE--
TEST
toSymbol(), $t->toSID(), $t->toString());
?>
diff --git a/tests/Symbol/Table.phpt b/tests/Symbol/Table.phpt
index 9fdc862..5480257 100644
--- a/tests/Symbol/Table.phpt
+++ b/tests/Symbol/Table.phpt
@@ -7,9 +7,9 @@ TEST
find(1));
+var_dump(ion\Symbol\System::asTable());
+var_dump(ion\Symbol\PHP::asTable());
+var_dump(ion\Symbol\PHP::asTable()->find(1));
echo "shared\n";
$shared = new ion\Symbol\Table\Shared("shared");
@@ -31,7 +31,7 @@ var_dump($shared->find($sid3));
echo "local\n";
$local = new ion\Symbol\Table\Local;
echo "import PHP\n";
-$local->import(ion\Symbol\Table\PHP());
+$local->import(ion\Symbol\PHP::asTable());
echo "import shared\n";
$local->import($shared);
diff --git a/tests/Writer.phpt b/tests/Writer.phpt
index 816803c..1a04a14 100644
--- a/tests/Writer.phpt
+++ b/tests/Writer.phpt
@@ -55,7 +55,7 @@ $w->finishLob();
echo "\n";
$w->startContainer(ion\Type::Struct);
$w->writeFieldName("prop");
-$w->writeAnnotation(ion\Symbol\Table\PHP::Property->toSymbol());
+$w->writeAnnotation(ion\Symbol\PHP::Property->toSymbol());
$w->writeInt($w->getDepth());
$w->writeFieldName(new ion\Symbol("priv"));
$w->writeAnnotation("a","b","c");