/**
* 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
{
$symfonyStyle = new SymfonyStyle($input, $output);
$model = $this->getUpdateInfo();
$data = $model->getUpdateInformation();
$symfonyStyle->title('Joomla! Updates');
if (!$data['hasUpdate']) {
$symfonyStyle->success('You already have the latest Joomla version ' . $data['latest']);
return Command::SUCCESS;
}
$symfonyStyle->note('New Joomla Version ' . $data['latest'] . ' is available.');
if (!isset($data['object']->downloadurl->_data)) {
$symfonyStyle->warning('We cannot find an update URL');
}
return Command::SUCCESS;
}