Hello i'm trying to use dependency injection outside of controller but i always have an error message that say : Too few arguments to function (...), 0 passed in (...) and exactly 1 expected.
Here is my code :
<?php
namespace App\Response;
use Psr\Log\LoggerInterface;
class TestResponse
{
public function __construct(private LoggerInterface $logger)
{}
}
Normally with autowiring it sould work but here no ... I don't understand why
i've try to inject dependency as parameter like in controllers but this not working The autowiring is enabled I think is natively possible like in controllers, without adding new package to do that
Help me