magento-ecg / coding-standard

Magento PHP_CodeSniffer Coding Standard
MIT License
308 stars 100 forks source link

Add PHP_Codesniffer to require #54

Closed davidwindell closed 7 years ago

davidwindell commented 7 years ago

We use fresh Docker images per project so we wouldn't install it globally.

If you have global required it, won't composer detect this and not install on the project level?

zlik commented 7 years ago

@davidwindell, I apologize I had to revert the pull request because PHPCS will actually be installed on the project level even when installed globally. You can add a command to install PHPCS globally to your provisioning script. I updated README with the recommended installation method.

zlik commented 7 years ago

@davidwindell, Note: Alternatively to installing PHP_CodeSniffer globally, you can include dependencies for both magento-ecg/coding-standard and squizlabs/php_codesniffer in your composer.json file. For example:

{
    "require": {
        "magento-ecg/coding-standard": ">=3.0",
        "squizlabs/php_codesniffer": "3.*"
    }
}
davidwindell commented 7 years ago

Yep, that's what we've been doing but the usual practice is to require all dependencies at the vendor level.