bamarni/composer-bin-plugin

Cross bin confusion with phpcs and dealerdirect/phpcodesniffer-composer-installer

Closed this issue · 3 comments

So, having composer bin install phpcs with Wordpress standards works just fine:

$ composer global bin wordpress require squizlabs/php_codesniffer wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
$ phpcs -i
## The installed coding standards are Squiz, PSR1, PEAR, PSR12, Zend, PSR2, MySource, WordPress-Core, WordPress-Extra, WordPress and WordPress-Docs

However, once phpcs and Drupal standards are installed to a different bin, phpcs stops seeing all custom standards

$ composer global bin drupal require squizlabs/php_codesniffer drupal/coder dealerdirect/phpcodesniffer-composer-installer
$ phpcs -i
## The installed coding standards are Squiz, PSR1, PEAR, PSR12, Zend, PSR2 and MySource

Not sure whether it's an issue with composer-bin-plugin or dealerdirect/phpcodesniffer-composer-installer or both.

I think this is happening because both provides a phpcs bin, hence there is a conflict and the plugin cannot tell which one to pick

yeah, that's likely it. although the linked executable is from the first bin.

Clarified this behaviour in https://github.com/bamarni/composer-bin-plugin#disable-links. Will be closing this now :)