title: Symfony - Duplicate class definition in cache
body: <p>I've created a very simple Symfony (3.4) project, with only one api that prints out a static json.</p>
  
  <p>When i run that api for the first time everything works fine, but from second time i got this error:</p>
  
  <pre><code>(1/1) FatalErrorException
  Compile Error: Cannot redeclare class Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser
  in ControllerNameParser.php (line 24)
  </code></pre>
  
  <p>This is why inside <code>cache/{env}/classes.php</code> that class was redefined. In fact, clearing cache turn api to work, but again only for the first time.</p>
  
  <p>How can I solve the issue? I think could be something related to composer.json autoload, here the snip</p>
  
  <pre><code>    "autoload": {
      "psr-4": {
          "AppBundle\\": "src/AppBundle",
          "MyCompany\\TypeBundle\\": "src/MyCompany/TypeBundle"
      },
      "classmap": [
          "app/AppKernel.php",
          "app/AppCache.php"
      ]
  },
  </code></pre>
  
  <p>Thanks in advance</p>