What would be a proper way to have a Service (that will be used by a Command) write information to the terminal? I like the same functionality to parse thousands of records to be able to be called from both a Controller and a Command. When it's called from the Command, I like to write a status to the terminal for every parsed record.
I've tried autowiring InputInterface $input, OutputInterface $output into the service but that gives me the following error:
Cannot autowire service "App\Service\Command\TestIoService": argument "$input" of method "__construct()" references interface "Symfony\Component\Console\Input\InputInterface" but no such service exists. Did you create a class that implements this interface?
I could pass the input and output to the service but I was wondering if there is a better way to do this