public function call(string $command, array $parameters = [], ?OutputInterface $outputBuffer = null): int
    {
        if (\is_subclass_of($command, SymfonyCommand::class)) {
            /** @var \Symfony\Component\Console\Command\Command $symfonyCommand */
            $symfonyCommand = $command;

            if (($commandName = $symfonyCommand::getDefaultName()) !== null) {
                $command = $commandName;
            }
        }

        if (! $this->has($command)) {
            throw new CommandNotFoundException(\sprintf('The command [%s] does not exist.', $command));
        }

        $this->lastOutput = $outputBuffer ?: new BufferedOutput();

        $this->setCatchExceptions(false);

        \array_unshift($parameters, $command);

        $input = new ArrayInput($parameters);

        if ($input->hasParameterOption(['--no-interaction'], true)) {
            $input->setInteractive(false);
        }

        $result = $this->run($input, $this->lastOutput);

        $this->setCatchExceptions(true);

        return $result;
    }