title: Composer complains about non-compliance to PSR-4, even though everything seems fine
body: <p>In my project, I'm including a package I'm developing, which has a composer.json, which includes the following autoload entry:</p>
  <p>(censored to not get in trouble with my company of course)</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;autoload&quot;: {
          &quot;psr-4&quot;: {
              &quot;Vendor\\Package\\&quot;: &quot;src/Package&quot;
          }
      }
  }
  </code></pre>
  <p>The main project and the package both have a composer.json, this is from the package's composer.json</p>
  <p>I have also seen some examples that only used &quot;Vendor\\&quot;, but this resulted in the exact same issue.</p>
  <p>I am requiring the package on version tag (from a git repository), so it should get and install the package correctly.</p>
  <p>Any time composer runs autoload, it complains the namespaces don't conform to PSR-4. I have checked the capitalisation, which all checks out. It complains about pretty much every php file in my project. Here's an example of the file structure:</p>
  <pre><code>vendor
  |- package
   |- src
    |- Package
     |- PackageServiceProvider.php
  </code></pre>
  <p>The namespace of PackageServiceProvider.php is <code>Vendor\Package</code>, and the class is <code>PackageServiceProvider</code>.
  As far as I know, this is how it's supposed to be. Yet composer still gives the deprecation notice.</p>
  <p>I should probably mention that I have also tried running <code>composer clearcache</code> between all of the things I've tried (which are mainly changing capitalisation), which didn't help.</p>
  <p>I am completely out of ideas on how to fix this.</p>
  <p>I'm on composer version 1.10.13, and Laravel version 5.8.38.</p>
  <p>One of the many deprecation notices I'm getting:</p>
  <pre><code>Deprecation Notice: Class Vendor\Package\PackageServiceProvider located in D:/wwwroot/project/vendor/{package-vendor}/package/src/Package\PackageServiceProvider.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar://C:/Users/me/AppData/Local/ComposerSetup/bin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
  </code></pre>