aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/WebAssembly/Debug
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-11 04:20:25 +0900
committernsfisis <nsfisis@gmail.com>2024-07-11 04:20:25 +0900
commit5be97eadbb1065f842aad4341cd4732498e0553b (patch)
tree827560953ea0abf494b3bb7aae9a987d105a8da3 /src/WebAssembly/Debug
parent8a083ed74e9f4472441175e187208012927ed357 (diff)
downloadphp-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.tar.gz
php-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.tar.zst
php-waddiwasi-5be97eadbb1065f842aad4341cd4732498e0553b.zip
feat: simplify FuncType structure
Diffstat (limited to 'src/WebAssembly/Debug')
-rw-r--r--src/WebAssembly/Debug/Debug.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/WebAssembly/Debug/Debug.php b/src/WebAssembly/Debug/Debug.php
index 60ac99b..99eefb0 100644
--- a/src/WebAssembly/Debug/Debug.php
+++ b/src/WebAssembly/Debug/Debug.php
@@ -11,7 +11,6 @@ use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\GlobalType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\Limits;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\MemType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\Mut;
-use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ResultType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\TableType;
use Nsfisis\Waddiwasi\WebAssembly\Structure\Types\ValType;
@@ -64,8 +63,8 @@ final readonly class Debug
private static function funcTypeToString(FuncType $type): string
{
- $params = self::resultTypeToString($type->params);
- $results = self::resultTypeToString($type->results);
+ $params = implode(', ', array_map(self::valTypeToString(...), $type->params));
+ $results = implode(', ', array_map(self::valTypeToString(...), $type->results));
return "($params) -> ($results)";
}
@@ -96,9 +95,4 @@ final readonly class Debug
Mut::Var => 'var',
};
}
-
- private static function resultTypeToString(ResultType $type): string
- {
- return implode(', ', array_map(self::valTypeToString(...), $type->types));
- }
}