When do you use require-dev? What are the common dependencies on developers?

While I am familiar with the basics of composer.json and defining dependencies under the require key, I do not quite understand the purpose of require-dev - composer documentation:

require-dev (root only)

Lists packages needed to develop this package or run tests, etc. The requirements of the root package developer are set by default. Both installation or upgrade options support the -no-dev option, which prevents the installation of dependencies between developers.

In an abstract sense, this makes sense, but it's hard for me to imagine situations when I need this functionality.

  • What are practical examples of using require-dev in a workflow?
  • Is there an example package (or packages) that should be in require-dev , but not in require ?
+5
php dependency-management composer-php
Aug 29 '13 at 20:09
source share
1 answer

One common example is phpunit, which you need to develop your test suite, but in general it will not be needed. It may also be assembly tools or such things. There is no huge harm in demanding all this, but it just means that you have more code installed on your machines and can slow down your builds a bit depending on how you make them.

+11
Aug 29 '13 at 22:08
source share



All Articles