false, 'has_countdown' => false, 'has_code' => false]; if (!is_array($tree)) return $facts; TemplateTree::rewrittenIn(['template' => ['tree' => $tree]], static function (array $node) use (&$facts): array { $type = $node['type'] ?? null; if ($type === 'button' && ($node['action'] ?? null) === 'link') $facts['has_link_button'] = true; if ($type === 'countdown') $facts['has_countdown'] = true; if ($type === 'code') $facts['has_code'] = true; return $node; }); return $facts; } }