diff --git a/metagen.inc.php b/metagen.inc.php index d389220..cdff5fc 100644 --- a/metagen.inc.php +++ b/metagen.inc.php @@ -5,7 +5,7 @@ interface mtgType class mtgTypeRef implements mtgType { - private static $all = array(); + private static $unresolved = array(); private $name; private $file; @@ -26,19 +26,23 @@ class mtgTypeRef implements mtgType $this->name = $name_or_resolved; if(!$module) throw new Exception("Module is not set"); + + self::$unresolved[] = $this; } $this->module = $module; $this->file = $file; $this->line = $line; - self::$all[] = $this; } static function checkAllResolved() { - foreach(self::$all as $ref) + while(sizeof(self::$unresolved) > 0) + { + $ref = array_shift(self::$unresolved); $ref->resolve(); + } } function resolve()