The instructions for Coder and the code sniffer module tell us that we should download coder into Drush's global command directory to make code sniffer and drush integration work for everyone. This is all fine and great. However, if you download coder and install it on a Drupal site on the same computer/server, and run anything with Drush, you get the following error:

PHP Fatal error: Cannot redeclare coder_review_drush_help() (previously declared in /usr/share/drush/commands/coder/coder_review/coder_review.drush.inc:63) in ...sites/all/modules/contrib/coder/coder_review/coder_review.drush.inc on line 39

This means that we cannot run Drush through the Drupal UI at all and means we can never install it as a module, which was unexpected.

Comments

slefevre1’s picture

I'm getting this error also.

dcmouyard’s picture

Confirming that this is still a problem.

douggreen’s picture

This is a problem, there isn't an easy solution, I hope to solve it with #2099351: Coder Drupal 8.x Battleplan.

dkh’s picture

I'd love to see a fix for this too. I have coder in ~/drush but my University's main install profile also has it in the modules directory, which I have to remove everytime I do a local site install.

rooby’s picture

esomething’s picture

I deleted the files in ~/.drush/cache/default and the error went away.

klausi’s picture

Status: Active » Closed (won't fix)

Coder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.