Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I think the generator system is nearing a point where it can support this.
We would need:
- the code body array to be keyed in some way that tells you what that piece is: function name, 'php header', 'file docblock', classname, class::method, class end.
- the file generator then need to check whether there is an existing file, and if so, analyze that and reduce that to a similar list
- diff the list
- only output the new pieces
This would probably need a new abstract class below File for PHP code.
Comments
Comment #1
joachim CreditAttribution: joachim commentedThe drush command used to have an --add option, which just appended code to a file. Not sure if it still works, but that could be resurrected as an interim measure.
Comment #2
joachim CreditAttribution: joachim commentedSee https://github.com/drupal-code-builder/drupal-code-builder/issues/159