improve shared symbol tables
[awesomized/ext-ion] / ion.stub.php
index e7a977d7e0597dcb38a8cb76cf278b41ce6df3bd..2e3324308495335e0c612d94437dcb1b059fd14c 100644 (file)
@@ -131,13 +131,15 @@ class Local implements \ion\Symbol\Table {
 
 namespace ion\Symbol\Table;
 class Shared implements \ion\Symbol\Table {
-    private array $symbols = [];
-
     public function __construct(
         public readonly string $name,
         public readonly int $version = 1,
+        ?array $symbols = null,
     ) {}
 
+    /** Internal cache */
+    private array $symbols = [];
+
     /** @alias ion\Symbol\Table::getMaxId */
     public function getMaxId() : int {}
 
@@ -151,6 +153,7 @@ class Shared implements \ion\Symbol\Table {
 
 namespace ion;
 class Catalog implements Countable {
+    /** Internal cache */
     private array $symbolTables = [];
 
     public function __construct() {}