Closed
Description
Description
Hey there,
I want to create a file containing informations via symfony/console
.
I'd like to pass the executed command to that file so it can be easily re-created later on (e.g. due to changes which have to be applied).
I've seen that ArgvInput
as well as ArrayInput
both already implement __toString
method and thus, extending the InputInterface
with the Stringable
interface might be a solution.
Example
interface InputOption extends Stringable
{}
final class MyCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln(sprintf('You executed the following command: %s', (string) $input));
return self::SUCCESS;
}
}
Any feedback is appreciated.