Fixing typos

This commit is contained in:
Pavel Shevaev 2022-12-08 19:30:54 +03:00
parent ed85853be4
commit a0461bf3a3
1 changed files with 4 additions and 4 deletions

View File

@ -82,7 +82,7 @@ function _add_twig_support(\Twig\Environment $twig)
}
));
$twig->addFunction(new \Twig\TwigFunction('get_all_fields',
function($meta, $o)
function($o)
{
return \mtg_get_all_fields($o);
}
@ -253,13 +253,13 @@ function field_reset($name, \mtgType $type, array $tokens)
}
else if($type instanceof \mtgArrType)
{
$str = "if self.$name == nil { \nself.$name = make(".go_type($field->getType(), $field->getTokens()).",0) \n}\n ";
$str = "if self.$name == nil { \nself.$name = make(".go_type($type, $tokens).",0) \n}\n ";
$str .= "self.$name = self.{$name}[0:0]";
}
else if($type instanceof \mtgMetaEnum)
{
if(array_key_exists('default', $tokens))
$str = "self.$name = ".go_type($field->getType(), $field->getTokens())."_".trim($tokens['default'], '"');
$str = "self.$name = ".go_type($type, $tokens)."_".trim($tokens['default'], '"');
else
$str = "self.$name = 0";
}
@ -267,7 +267,7 @@ function field_reset($name, \mtgType $type, array $tokens)
{
$is_virtual = array_key_exists("virtual", $tokens);
if($is_virtual)
$str .= "self.$name = New".ltrim(go_type($field->getType(), $field->getTokens()),'I')."() ";
$str .= "self.$name = New".ltrim(go_type($type, $tokens),'I')."() ";
else
$str .= "self.$name.Reset()";
}