title: Need help in solving the class not found error in PHP while refactoring the code
body: <p>I have just started digging into PHP OOPs concept. For this I have created a Class and an Interface in the same file. Everything works well till this moment. Further I started refactoring my code and separated both Class and Interface to their respective files. After this I am getting below error:</p>
  
  <blockquote>
    <p>Fatal error: Interface 'TaskInterface' not found in E:\www\project\oop\Tasks.php on line 4</p>
  </blockquote>
  
  <p>Below line solve that error, however I need a way to resolve it through Composer and Namespace.</p>
  
  <pre><code>require 'TaskInterface.php';
  </code></pre>
  
  <p>Both of the files are under same directory level.</p>
  
  <p>Class Tasks: (Tasks.php)</p>
  
  <pre><code>use App\TaskInterface;
  require_once 'vendor/autoload.php';
  class Tasks implements TaskInterface {
   public function create()
   {
      var_dump('created');
   }
  }
  $obj = new Tasks();
  echo $obj-&gt;create();
  </code></pre>
  
  <p>Interface Task: (TaskInterface.php)</p>
  
  <pre><code>namespace App;
  interface TaskInterface {
   public function create();
  }
  </code></pre>
  
  <p>Here is composer.json code to autoload class/interface:</p>
  
  <pre><code>{
  "name" : "OOP",
  "autoload": {
      "psr-4": {
          "App\\": "project/oop/"
      }
   }
  }
  </code></pre>
  
  <p>Project URL: <a href="http://localhost/project/oop/tasks.php" rel="nofollow noreferrer">http://localhost/project/oop/tasks.php</a></p>
  
  <p>Directory Structure:</p>
  
  <pre><code>|project
  |oop
    -|vendor
       -|composer (containing all auto generated files)
       -|autoload.php
    -|composer.json
    -|TaskInterface.php
    -|Tasks.php
  </code></pre>