Problem/Motivation

Could not instantiate Drupal\clamav\Drush\Commands\ClamavCommand: Too few arguments to function Drupal\Clamav\Drush\Commands\ClamavCommand::__construct(), 0 passed in /var/www/html/vendor/drush/drush/src/Runtime/ServiceManager.php on line 333 and exactly 3 expected

Steps to reproduce

Run this command using Drush 12.5.3:

drush clamav:scan-files -vvv

Proposed resolution

Update the module to use autowire instead of drush.services.yml

CommentFileSizeAuthor
#2 clamav-3518270-2.patch1.28 KBjohn.oltman

Comments

john.oltman created an issue. See original summary.

john.oltman’s picture

StatusFileSize
new1.28 KB
abu-zakham’s picture

Status: Active » Reviewed & tested by the community

Patch #2 fixed the issue

jannakha’s picture

Status: Reviewed & tested by the community » Needs work

thank you for your contribution.

can you please create a fork and merge request
this will speed up review, testing and release process.

sokru’s picture

Once #3502321: Add unit tests lands we can add tests also for Drush command, I already have some wip-tests based on that issue

mcdruid’s picture

Looking at:

* https://www.drush.org/13.x/dependency-injection/
* https://www.drush.org/13.x/install/

...it seems that the drush.services.yml approach "is deprecated in Drush 12+ and removed in Drush 14."

Drush 11 went EoL in Nov 2023.

However, would it do any harm to leave the services.yml file in place (alongside adding autowire) for a bit longer for BC?