The structure of my project is as follows:
Handler.php
is input script. Here is its beginning:
require "vendor/autoload.php";
use \App\TgHelpers\TelegramCommandsProcess;
$tgProcessor = new TelegramCommandsProcess();
All scripts are in the same namespace - App. An error is displayed in the logs:
PHP Fatal error: Uncaught Error: Class 'App\\TgHelpers\\TelegramCommandsProcess' not found
What am I doing wrong?
Here is the autoload field in composer.json
:
"autoload": {
"psr-4": {
"App\\": "testVersionTelegramForecast//"
}
}
the register must match
\App\TgHelpers\ => project/TgHelpers
,composer.json
should be at the root of your projectIn Handler.php