diff --git a/src/codegen.inc.php b/src/codegen.inc.php index cecdd20..ba19a31 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -155,7 +155,7 @@ function _add_twig_support(\Twig\Environment $twig) $twig->addFunction(new \Twig\TwigFunction('get_diff_related_units', function($o) { - return get_all_related_structs($o); + return get_diff_all_related_structs($o); } )); $twig->addFunction(new \Twig\TwigFunction('get_all_declarable_accessor_interfaces', @@ -520,7 +520,7 @@ function get_diff_related_units(\mtgMetaStruct $struct) return $result; } -function get_all_related_structs(\mtgMetaStruct $struct): array +function get_diff_all_related_structs(\mtgMetaStruct $struct): array { $result = array_reduce($struct->getFields(), function(array $structs, \mtgMetaField $field) { if($field->hasToken('nodiff')) @@ -544,7 +544,7 @@ function get_all_related_structs(\mtgMetaStruct $struct): array foreach($result as $s) { - $result = array_merge(get_all_related_structs($s), $result); + $result = array_merge(get_diff_all_related_structs($s), $result); } return $result;