Я пытаюсь зарегистрировать командный класс как службу в Symfony. Когда я запускаю bin / console, я получаю следующую ошибку:
In App_KernelDevDebugContainer.php line 644:
Attempted to load class "Runner" from namespace "App\Command\Circuit".
Did you forget a "use" statement for another namespace?
Вот так я регистрирую службу:
services:
App\Command\Circuit\Runner:
tags:
- { name: 'console.command', command: 'run' }
И вот как выглядит класс команды:
namespace App\Command\Circuit;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class Runner extends Command
{
protected function configure()
{
$this
->setName('run');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$time = time();
file_put_contents("{$time}.txt", 'test');
}
}
Я следовал symfony учебник , но я уверен, что кое-что я забыл, проводя эту услугу.