Problem/Motivation
This module currently uses Drush 10. But:
- Drush 11 is EOL. Drupal 10 requires Drush 12.5+.
- Drush 12 works on Drupal 10 but not Drupal 11.
- Drush 13 is required for Drupal 11 but will also work on Drupal 10.2+.
https://www.drush.org/13.x/install/#drupal-compatibility
Proposed resolution
Upgrade Radioactivity module Drush commands for Drush 13+, as this is the only Drush version that will work with Radioactivity 4.1.x.
The big things here are to use PHP Attributes instead of Annotations for Commands, and to use autodiscovery instead of drush.services.yml, and to use autowiring instead of service injection.
These things are supported by Drush 12 and required in Drush 13.
Remaining tasks
Basic steps that apply to this module are:
- Change namespace and class naming according to https://www.drush.org/12.x/commands/#auto-discovered-commands-psr4
- Add use statement for Drush PHP attribute classes.
- Use PHP attributes for Drush command definitions, as per https://www.drush.org/12.x/commands/#attributes-or-annotations
- Do not remove the Drush annotations yet - that will make these changes easier to review and easier to fix if a problem is noticed.
- Remove drush.services.yml and remove drush.services.yml from composer.json. Drush commands will be autoloaded.
- Use Autowire instead of dependency injection.
- Add parameter and return type hints to all methods. Turn on strict_types.
Issue fork radioactivity-3503754
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tr commentedComment #4
tr commentedAll new features should have tests.
This is an old feature, but because we're making big changes to the implementation it would be wise IMO to add a new test to ensure this feature works properly.
Here is a first pass at a new test.
Comment #5
tr commentedThe new test now passes, but it is trivial so far and needs to be enhanced before I commit this.
Comment #6
tr commentedComment #7
tr commentedComment #8
tr commentedHere's the enhanced test. Maybe could be simplified a bit, but this seems to work locally.
Comment #10
tr commented