We currently store several of our "replace with this" code in Twig templates like http://cgit.drupalcode.org/drupalmoduleupgrader/tree/templates/Block.htm... This is because a) Twig already has a token-replacement system that most D8 developers know how to use so why not, and b) they're super easy to edit, even for people who don't know Twig.

However, this causes some brittleness (see #2408745: dmu-upgrade fails with Pharborist parse errors if Twig debug mode is on (chokes on HTML comments in PHP source)), and also requires us to use SimpleTest instead of PHPUnit. So while I weep a bit at the loss in DX, at the end of the day people contributing to this project need to be somewhat fluent in Pharborist anyway, and this'll make the code more robust.

Comments

webchick’s picture

EclipseGc pointed out this library of his https://github.com/EclipseGc/Classiphpy that utilizes Pharborist. Might be worth taking a gander at.

mlncn’s picture