title: Why composer install --no-dev does not work?
body: <p>I am developing a package library which has regular dependencies and one dev dependency. <a href="https://getcomposer.org/doc/02-libraries.md#lock-file" rel="noreferrer">Composer recommends to not include the <code>composer.lock</code> file for libraries</a>, so here is the <code>composer.json</code></p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;name&quot;: &quot;myself/mypackage&quot;,
      &quot;require&quot;: {
          &quot;php&quot;: &quot;&gt;=5.6&quot;,
          &quot;nesbot/carbon&quot;: &quot;~1.20&quot;
      },
      &quot;require-dev&quot;: {
          &quot;phpunit/phpunit&quot;: &quot;^6.0&quot;
      }
  }
  </code></pre>
  <p>I want this to be compatible for use with applications running PHP 5.6, and I want to develop it using the latest PHPUnit testing tools which require PHP 7.</p>
  <p>On the travis continuous integration testing server, I have a build matrix which runs the PHPUnit tests on PHP &gt; 7 and a linting script:</p>
  <pre><code>composer install
  ./lint-php.bash
  phpunit
  </code></pre>
  <p>and on PHP &lt; 7, simply lint the source code:</p>
  <pre><code>composer install --no-dev
  ./lint-php.bash
  </code></pre>
  <p>However, it fails because it ignores the <code>--no-dev</code> flag and tries to install the dev dependency anyway.</p>
  <blockquote>
  <pre><code>Your requirements could not be resolved to an installable set of packages.
  
    Problem 1
      - phpunit/phpunit 6.0.7 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.6 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.5 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.4 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.3 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.2 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.1 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - phpunit/phpunit 6.0.0 requires php ^7.0 -&gt; your PHP version (5.6.5) does not satisfy that requirement.
      - Installation request for phpunit/phpunit ^6.0 -&gt; satisfiable by phpunit/phpunit[6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7].
  </code></pre>
  </blockquote>
  <p>Why is it ignoring the <code>--no-dev</code> flag? I just want it to install my regular dependencies and to ignore the <code>require-dev</code> section.</p>