installation-bundle/src/EventListener/InitializeApplicationListener.php
private function runCommand(Command $command, InputInterface $input): ?string
    {
        if ($command instanceof ContainerAwareInterface) {
            $command->setContainer($this->container);
        }

        $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true);
        $status = $command->run($input, $output);

        if ($status > 0) {
            return $output->fetch();
        }

        return null;
    }
private function runCommand(Command $command, InputInterface $input): ?string
    {
        if ($command instanceof ContainerAwareInterface) {
            $command->setContainer($this->container);
        }

        $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true);
        $status = $command->run($input, $output);

        if ($status > 0) {
            return $output->fetch();
        }

        return null;
    }
Runs a command and returns the error (if any).