You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installed "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", my Composer getting error about phpcs 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 every composer is producing the error.
Expected behaviour
The processing should be ignored when the binary can't be found.
Actual behaviour
$ composer global show
Changed current directory to /Users/kenorb/.composer
[Symfony\Component\Process\Exception\ProcessFailedException]
The command "'/Users/kenorb/.composer/vendor/bin/phpcs' '--config-show' 'installed_paths'" failed.
Exit Code: 127(Command not found)
Working directory: /Users/kenorb/.composer
Output:
================
Error Output:
================
sh: /Users/kenorb/.composer/vendor/bin/phpcs: No such file or directory
global <command-name> [<args>]...
Exception trace:
() at phar:///usr/local/Cellar/composer/1.6.3/libexec/composer.phar/vendor/symfony/process/Process.php:221
Symfony\Component\Process\Process->mustRun() at /Users/kenorb/.composer/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:183
Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->loadInstalledPaths() at /Users/kenorb/.composer/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:121
Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->init() at /Users/kenorb/.composer/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php:103
Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->activate() at phar:///usr/local/Cellar/composer/1.6.3/libexec/composer.phar/src/Composer/Plugin/PluginManager.php:236
Composer\Plugin\PluginManager->addPlugin() at phar:///usr/local/Cellar/composer/1.6.3/libexec/composer.phar/src/Composer/Plugin/PluginManager.php:205
Composer\Plugin\PluginManager->registerPackage() at phar:///usr/local/Cellar/composer/1.6.3/libexec/composer.phar/src/Composer/Plugin/PluginManager.php:261
...
Steps to reproduce
COMPOSER_BIN_DIR="/usr/local/bin" composer global require dealerdirect/phpcodesniffer-composer-installer:^0.4.3
composer -v global show
Proposed changes
The plugin should be less invasive.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: