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.
This allows extending the class by creating child classes simpler: calls like StatsD::timing() are essentially equivalent to adding a "final" modifier. By creating an instance in a factory class (statsd_instance in the suggested patch), any module wishing to implement an alternate version may just implement its own factory, create a derived class, and everything will still work using the new class overrides instead of the original method when they exist.
This also makes unit testing simpler, making mocks possible.
The suggested patch also adds a new-style (PSR-0, à la Drupal 8) test suite.
Comment | File | Size | Author |
---|---|---|---|
#1 | 0001-Issue-2023927-by-fgm-convert-class-methods-from-stat.patch | 13.96 KB | fgm |
Comments
Comment #1
fgmSuggested patch applies on top of #2023431: Make module pass coder/codesniffer review, and also fixes an error in statsd_uninstall, which invoke "variabel_del" instead of "variable_del".
Comment #2
Nick_vhLet's make a new branch with this patch as it breaks compatibility with the current version and people's site will break if they just upgrade with this patch.