Closed kenorb closed 6 years ago
Hi! Thank you for taking the time to report this.
This behaviour seems to be caused by the fact that the plugin functionality is called when it should not be. In other words, the plugin is triggered for an event it is not registered for.
The root cause is that the (public) activate
function calls the (private) init
function which, in turn, triggered calling PHPCS (in the loadInstalledPaths
function).
A potential solution would be simply move the init
call into the onDependenciesChangedEvent
function.
That way init is only called when the plugin is about to be used, rather than on any composer command.
Looks like PR #51 addresses this issue.
This is indeed addressed by #51, which has been merged in and will be part of the next release.
Problem/Motivation
After installed
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
, my Composer getting error aboutphpcs
command not being found.This happens, when I am working with multiple bin-dir folders. Normally I've got
COMPOSER_BIN_DIR
pointed to/usr/local/bin
, but in some shell instances, I don't have. After installing this package, now everycomposer
is producing the error.Expected behaviour
The processing should be ignored when the binary can't be found.
Actual behaviour
Steps to reproduce
Proposed changes
The plugin should be less invasive.