inpsyde / php-coding-standards

Style guide for writing consistent PHP for WordPress projects.
MIT License
98 stars 23 forks source link

Composer require vs require-dev #19

Closed thefrosty closed 5 years ago

thefrosty commented 5 years ago

Curious as to why you've got most of these packages in the require vs the require-dev:

"require": {
    "php": ">=7.0",
    "squizlabs/php_codesniffer": "^3",
    "dealerdirect/phpcodesniffer-composer-installer": "^0.4",
    "wp-coding-standards/wpcs": "^0.14",
    "automattic/phpcs-neutron-standard": "^1",
    "wimg/php-compatibility": "^8.0"
  },
  "require-dev": {
    "phpunit/phpunit": "6.0.*"
},

I personally don't want all those packages going up to my PROD box.

widoz commented 5 years ago

If you define the inpsyde/php-coding-standard as dev package you'll not have it's requires into your prod. The requires are for the inpsyde package because it need them to work properly in your env. As you can read here https://getcomposer.org/doc/04-schema.md#require

bueltge commented 5 years ago

I close this issue because the answer from @widoz is solid. For our codex is it necessary to use require, but in other projects you should use it via reuire-dev, only for development. Thanks for your interest on our standard @thefrosty Great to see, that the open repository for this topic is a good idea.