title: PHP Uncaught Error: Class not found using composer autoload
body: <p>I'm writing a simple project using <em>SymfonyConsole</em> package, but I got class not found exception:</p>
  
  <pre><code>PHP Fatal error:  Uncaught Error: Class 'Project\ExtractLinkCommand' not found in /home/PhpstormProjects/RVLE/RVLE.php:9
  Stack trace:
  #0 {main}
    thrown in /home/PhpstormProjects/RVLE/RVLE.php on line 9
  </code></pre>
  
  <p>I can't find what the problem, somebody says autoloader is not standard and you should write it your own.
  I also updated composer and ran <code>composer dump-autoload</code>.</p>
  
  <p>Here are my files -></p>
  
  <p><strong>RVLE.php</strong>:</p>
  
  <pre><code>#!/usr/bin/env php
  &lt;?php
  require 'vendor/autoload.php';
  
  use Project\ExtractLinkCommand;
  use Symfony\Component\Console\Application;
  
  $app = new Application('RVLE' , '1.0');
  $app-&gt;add(new ExtractLinkCommand());
  $app-&gt;run();
  </code></pre>
  
  <p><strong>extractCommand.php</strong>:</p>
  
  <pre><code>&lt;?php namespace Project;
  use Symfony\Component\Console\Command\Command;
  use Symfony\Component\Console\Input\InputArgument;
  use Symfony\Component\Console\Input\InputInterface;
  use Symfony\Component\Console\Output\OutputInterface;
  
  class ExtractLinkCommand extends Command
  {
      public function configure()
      {
          $this-&gt;setName('getLinks')
              -&gt;setDescription('extract all available video links for given page url')
              -&gt;addArgument('url', InputArgument::REQUIRED, 'page link');
      }
  
      public function execute(InputInterface $input, OutputInterface $output)
      {
          $url = $input-&gt;getArgument('url');    
          $output-&gt;writeln($url);
      }
  }
  </code></pre>
  
  <p><strong>composer.json</strong>:</p>
  
  <pre><code>{
    "require": {
      "symfony/console": "^3.3"
    },
    "autoload": {
      "psr-4": {
        "Project\\": "src/"
      }
    }
  }
  </code></pre>
  
  <p>This is my project structure:</p>
  
  <pre><code>.
  ├── composer.json
  ├── composer.lock
  ├── RVLE.php
  ├── src
  │   └── extractCommand.php
  └── vendor
      ├── autoload.php
      ├── bin
      ├── composer
      ├── psr
      └── symfony
  </code></pre>