From 94d3f72daf0f110d1718f6e463600c6fcc928b41 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 16 Aug 2023 14:17:23 +0300 Subject: [PATCH] Making PHPStan happy --- src/codegen.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 3344a97..e009c5f 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -289,7 +289,7 @@ function go_type(\mtgType $type, array $tokens = []): string return "[]$native"; } else - throw new Exception("Unknown type '$type'"); + throw new Exception("Unknown type '{$type->getName()}'"); } function builtin_type_method_suffix(\mtgBuiltinType $type): string @@ -432,7 +432,7 @@ function field_reset($name, \mtgType $type, array $tokens) $str .= "self.$name.Reset()"; } else - throw new Exception("Unknown type '$type'"); + throw new Exception("Unknown type '{$type->getName()}'"); return $str; } @@ -481,7 +481,7 @@ function buf2var($name, $fname, \mtgType $type, $buf, array $tokens = array(), $ $str .= "\n"; } else - throw new Exception("Unknown type '{$type}'"); + throw new Exception("Unknown type '{$type->getName()}'"); return $str; } @@ -514,7 +514,7 @@ function var2buf($name, $fname, \mtgType $type, $buf, array $tokens = array(), $ $str .= " "._write_op("{$buf}.EndContainer()")."\n"; } else - throw new Exception("Unknown type '$type'"); + throw new Exception("Unknown type '{$type->getName()}'"); return $str; }