Released #DrupalCodeBuilder 4.5.3 with a critical fix: code analysis crashes when it encounters an event name constant with no docblock. Document your code! Also, fuck the fuck off out of my issue queues with garbage GenAI bug reports. They're full of bullshit, and if you expect me to put my time into fixing a bug, put your time into writing a bug report. #FuckAI
Arbitrary hooks classes are coming to Module Builder soon. Currently, all OO hooks are put in a single class, but the next release will allow any number of hooks classes, with injected services for each class. There's also token replacement for dynamic hook names, so you can add multiple copies of hook_form_FORM_ID_alter() and set the FORM_ID for each one. #Drupal #DrupalCodeBuilder
Bikeshed! The #DrupalCodeBuilder generated method name for a class-based hook whose name contains a token, such as hook_form_FORM_ID_alter() should be:
form_FORM_ID_Alter
0%
formFORM_ID_Alter
0%
formFORM_IDAlter
25%
formFORMIDAlter
75%
Poll ended at .
New release of #DrupalCodeBuilder adds a configuration option for constructor property promotion. This is a proposed coding standard for Drupal. https://github.com/drupal-code-builder/drupal-code-builder/releases/tag/4.4.8
Release 4.4.8 · drupal-code-builder/drupal-code-builder

Added: Added configuration option for promoting constructor parameters instead of assigning to properties. Fixed: Fixed admin settings form defining a route whose path is missing the initial ‘/’...

GitHub
New release of #DrupalCodeBuilder, because it hadn't occurred to me until I was generating hooks last week that it's a good idea to start writing all your hook implementations as OO hooks with legacy support, even if you're still on #Drupal 10. https://github.com/drupal-code-builder/drupal-code-builder/releases/tag/4.4.4
Release 4.4.4 · drupal-code-builder/drupal-code-builder

New features: Added legacy OO hooks on Drupal < 11. Bug fixes: Fixed config entity form texts using ‘entity’ instead of entity type label. Fixes #369. Fixed indirectly requested hooks crash beca...

GitHub
#DrupalCodeBuilder has got a lot of code for making #PHPUnit assertions on #PHP code, using nikic/php-parser - e.g. does this class implement an interface, does this method return a variable, etc. Would this be useful as a separate library? https://github.com/drupal-code-builder/drupal-code-builder/blob/4.4.x/Test/Unit/Parsing/PHPTester.php
drupal-code-builder/Test/Unit/Parsing/PHPTester.php at 4.4.x · drupal-code-builder/drupal-code-builder

A library for building Drupal code. Contribute to drupal-code-builder/drupal-code-builder development by creating an account on GitHub.

GitHub
I stupidly didn't think that you might want to generate hooks OO-style with legacy support on a site that's Drupal 9 or 10 -- so that your hooks code is ready for Drupal 11.1. Will be fixed in next version of #DrupalCodeBuilder -- soon! (or on branch `sandbox-oo-hooks-on-10` if you feel like experimenting!)
@dropismoving New release of #DrupalCodeBuilder generates OO-based hooks!
New releases of Module Builder, Drupal Code Builder AND Mutable Typed Data (which provides the dynamic data structure for entering all the options for your module). Don't forget the -W option with 'composer update'! #Drupal #DrupalCodeBuilder
OO-style hooks are coming to #Drupal core and #ModuleBuilder and #DrupalCodeBuilder are ready! https://www.drupal.org/node/3442349
Support for object oriented hook implementations using autowired services

Create a class in the Drupal\modulename\Hook namespace (or subdirectory). This will be automatically registered as an autowired service. Use the new Drupal\Core\Hook\Attribute\Hook attribute either on methods or on the class. If it is on the class and the class doesn't have an __invoke method then a method argument is required. The method implementing the hook has the same

Drupal.org