/**
* Internal function to execute the command.
*
* @param InputInterface $input The input to inject into the command.
* @param OutputInterface $output The output to inject into the command.
*
* @return integer The command exit code
*
* @since 4.0.0
*/
protected function doExecute(InputInterface $input, OutputInterface $output) : int
{
$this->configureIO($input, $output);
$extensions = $this->getExtensions();
$type = $this->cliInput->getOption('type');
if ($type) {
$extensions = $this->filterExtensionsBasedOn($type);
}
if (empty($extensions)) {
$this->ioStyle->error("Cannot find extensions of the type '{$type}' specified.");
return Command::SUCCESS;
}
$extensions = $this->getExtensionsNameAndId($extensions);
$this->ioStyle->title('Installed extensions.');
$this->ioStyle->table(['Name', 'Extension ID', 'Version', 'Type', 'Active'], $extensions);
return Command::SUCCESS;
}