Making PHPStan happy
This commit is contained in:
parent
97db32ffc7
commit
a1900d7e23
|
@ -221,7 +221,7 @@ function data2value($name, \mtgType $type, $buf, $prefix = '', $tokens = array()
|
|||
$str .= $cond_indent."{$pname} = \metagen_php\\val_enum('$type', {$tmp_val}, false);\n";
|
||||
}
|
||||
else
|
||||
throw new Exception("Unknown type '{$type}'");
|
||||
throw new Exception("Unknown type '{$type->getName()}'");
|
||||
|
||||
if($postfix)
|
||||
$str .= $cond_indent.$postfix."\n";
|
||||
|
@ -286,7 +286,7 @@ function value2data($name, \mtgType $type, $buf, $prefix = '', $tokens = array()
|
|||
$str .= $indent."\metagen_php\array_set_value({$buf}, \$assoc, '$name', \$arr_tmp__);\n";
|
||||
}
|
||||
else
|
||||
throw new Exception("Unknown type '{$type}'");
|
||||
throw new Exception("Unknown type '{$type->getName()}'");
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
|
|
@ -76,13 +76,8 @@ class {{o.name}} {{o.parent ? 'extends ' ~ o.parent.name}}
|
|||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($IDX > -1)
|
||||
{
|
||||
$FIELDS = self::CLASS_FIELDS();
|
||||
throw new Exception($e->getMessage() . " < {$FIELDS[$IDX]}");
|
||||
}
|
||||
else
|
||||
throw $e;
|
||||
$FIELDS = self::CLASS_FIELDS();
|
||||
throw new Exception($e->getMessage() . " < {$FIELDS[$IDX]}");
|
||||
}
|
||||
if($root && $assoc && sizeof($data) > 0)
|
||||
throw new Exception("Junk fields: " . implode(',', array_keys($data)));
|
||||
|
@ -128,7 +123,9 @@ class {{o.name}} {{o.parent ? 'extends ' ~ o.parent.name}}
|
|||
{% endmacro %}
|
||||
|
||||
{% macro decl_struct_field(o, f) ~%}
|
||||
/** @var {{f.type}}*/
|
||||
{%- if f.type is instanceof('\\mtgMetaStruct') ~%}
|
||||
/** @var {{f.type}}|null*/
|
||||
{%- endif -%}
|
||||
{%- if f.type is instanceof('\\mtgBuiltinType') and f.type.isstring ~%}
|
||||
public ${{f.name}} = '';
|
||||
{%- elseif f.type is instanceof('\\mtgArrType') ~%}
|
||||
|
|
Loading…
Reference in New Issue