title: Symfony - Autoloader can't find class / composer error
body: <p>When I tried adding a new dependency to my project with <code>composer require xyz</code> I got the following error:</p>
  <blockquote>
  <p>The autoloader expected class &quot;PackageVersions\Versions&quot; to be defined in file &quot;.../vendor/ocramius/package-versions/src/PackageVersions/Versions.php&quot;.</p>
  <p>The file was found but the class was not in it, the class name or namespace probably has a typo.</p>
  </blockquote>
  <p>I dug into that file, to see that the <code>Versions</code>class is there, in the right file, but with a the following name:</p>
  <p><code>Versions_composer_tmp0</code></p>
  <p>The namespace declarations seem to be good in the entire project, as well as php opening tags (I read that might cause such problems).</p>
  <p>Additionally, I remarked that all the <code>use</code> statements in the <code>Installer</code> class file, which is the one that creates the <code>Versions</code> class are marked by phpstorm as <code>Undefined Classes</code>. They all should be found in the namespace <code>Composer\xyz</code>.</p>
  <p>I tried the following without succes:</p>
  <ul>
  <li>clearing the symfony cache</li>
  <li>clearing composer cache</li>
  <li><code>composer self-update</code></li>
  <li>deleting the <code>ocramius</code> vendor folder so that composer would download it again</li>
  <li>renaming the class, which is pointless since the entire purpose of this <code>Versions</code> class is to be rewritten with each <code>composer install</code> or <code>composer update</code></li>
  </ul>
  <p><strong>edit:</strong></p>
  <p>I'm trying to install <code>1up-lab/OneupUploaderBundle</code>, the <code>Ocramius/PackageVersions</code>is already there as a dependency probably (I did not require it manually)</p>
  <p><strong>edit 2:</strong></p>
  <p>I just saw that <code>server:run</code> won't work either. So the problem is definitely not related to the bundle I'm trying to install. I managed to make the server run by renaming the class from <code>Versions_composer_tmp0</code> to <code>Versions</code>.</p>