@deadsuperhero Twig is a popular and very good templating engine typically used in Symfony framework based PHP projects such as Drupal. It can be used in any PHP project, but I haven’t tried outside of the usual suspects.
What you just encountered is perfectly valid. Not ideal, but it’s WordPress and almost anything WordPress is light on structure. They just did that weird concatenation thing for readability.
Do you typically use WordPress for PHP projects or is this a side adventure?