title: How to auto generate a bundle in Symfony3?
body: <p>I've tried to automatically generate a bundle in Symfony3, using instructions on the official site: <a href="https://symfony.com/doc/current/bundles.html" rel="nofollow noreferrer">https://symfony.com/doc/current/bundles.html</a>, but failed.</p>
  <p>I created a directory <code>\src\TestBundle</code> in my project with a file <code>TestBundle.php</code> in it. I extended my class <code>TestBundle</code> from Bundle and added the <code>use Symfony\Component\HttpKernel\Bundle\Bundle;</code> line before the class declaration.</p>
  <p>I added my new bundle name to the bundles list in <code>AppKernel.php</code>.</p>
  <p>Finally, when I execute <code>$ php bin/console generate:bundle --namespace=TestBundle</code>, I get this error:</p>
  <blockquote>
  <p>PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class &quot;TestBundle&quot; from namespace &quot;TestBundle&quot;.</p>
  </blockquote>
  <p>Any ideas why that happens?</p>