'App/Controller not found in REST API Project

This is pure php project

Here is my composer.json code , when i debug "CatalogController.php" file , it gives me following error . Please help me to resolve this incident

https://prnt.sc/26jxg3y

Folder Structure

https://prnt.sc/26jxgyt

CatalogController.php - https://prnt.sc/26jxjw9

<?php
namespace App;
use Exception;

use App\Controller;
use App\CatalogModel;
use App\JwtMiddleware;
use App\RequestMiddleware;
class CatalogController extends Controller {
......
}

composer.json

{
  "require": {
    "klein/klein": "^2.1",
    "firebase/php-jwt": "^5.2"
  },
  "autoload": {
    "psr-4": {
      "App\": "App/"
    },
    "classmap": [
      "App/Controller",
      "App/Middleware",
      "App/Model"
    ]
  }
}

[+Updated]

Thanks my team. I resolved 90% . But i got this error. https://prnt.sc/26jzpxp

Please help me to resolve this incident.



Solution 1:[1]

  1. invalid namespace App or directory structure, read PSR-4 manualto understand how it use
  2. redundant import use App\*; in CatalogController.php - this classes in App namespace too
  3. invalid JSON "App\"
  4. redundant classmap section in composer.json - read Composer manual to understand how it use

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 WinterSilence