/**
* 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);
if ($eid = $this->cliInput->getOption('eid')) {
$result = $this->processDiscover($eid);
if ($result === -1) {
$this->ioStyle->error($this->getNote($result, $eid));
return Command::FAILURE;
} else {
$this->ioStyle->success($this->getNote($result, $eid));
return Command::SUCCESS;
}
} else {
$result = $this->processDiscover(-1);
if ($result < 0) {
$this->ioStyle->error($this->getNote($result, -1));
return Command::FAILURE;
} elseif ($result === 0) {
$this->ioStyle->note($this->getNote($result, -1));
return Command::SUCCESS;
} else {
$this->ioStyle->note($this->getNote($result, -1));
return Command::SUCCESS;
}
}
}