diff --git a/metagen.inc.php b/metagen.inc.php index e50acb4..76970a3 100644 --- a/metagen.inc.php +++ b/metagen.inc.php @@ -108,17 +108,14 @@ class mtgMetaInfoUnit public string $file; public mtgMetaUnit $object; - /** - * @param string|mtgMetaParsedModule $file_or_module - */ - function __construct($file_or_module, mtgMetaUnit $obj) + function __construct(mtgMetaParsedModule|string $file_or_module, mtgMetaUnit $obj) { if($file_or_module instanceof mtgMetaParsedModule) { $this->module = $file_or_module; $this->file = $file_or_module->file; } - else if(is_string($file_or_module)) + else { $this->module = null; $this->file = $file_or_module; diff --git a/tests/run.php b/tests/run.php index d18d98b..33bed3d 100755 --- a/tests/run.php +++ b/tests/run.php @@ -90,6 +90,6 @@ assert($u->object->getFields()["id"]->getType() == "EnumStock"); $u = $meta->findUnit("GameService"); assert($u->object instanceof mtgMetaService); -assert($u->object->getRPC("PING") instanceof mtgMetaRPC); +assert($u->object->getRPC("PING")->getName() == "PING"); assert($u->object->findSymbol("DataPing") instanceof mtgMetaStruct); assert($u->object->findSymbol("ErrorCode") instanceof mtgMetaEnum);