Describe the bug
ServiceManager::discoverPsr4Commands() requires the command class to be a subclass of DrushCommands, which means the new Symfony-style commands are not discovered unless I'm missing something.
The command is discovered if I move it under the src/Commands directory, but then the namespace must be Drush\Commands\package_name\Commands (I didn't dig too deep to figure out why), which does not comply with PSR-4 standards:
Class Drush\Commands\helfi_drupal_tools\Commands\PackageScannerCommands located in ./drush/Commands/helfi_drupal_tools/src/Commands/PackageScannerCommands.php does not comply with psr-4 autoloading standard (rule: DrupalTools\ => ./drush/Commands/helfi
_drupal_tools/src). Skipping.
To Reproduce
Create a PSR-4 Drush package with a new Symfony-style command.
System Configuration
| Q |
A |
| Drush version? |
14.x/13.x |
| Drupal version? |
11.x |
| PHP version |
8.4 |
| OS? |
Linux |
Describe the bug
ServiceManager::discoverPsr4Commands()requires the command class to be a subclass ofDrushCommands, which means the new Symfony-style commands are not discovered unless I'm missing something.The command is discovered if I move it under the
src/Commandsdirectory, but then the namespace must beDrush\Commands\package_name\Commands(I didn't dig too deep to figure out why), which does not comply with PSR-4 standards:To Reproduce
Create a PSR-4 Drush package with a new Symfony-style command.
System Configuration