Fix returns in Console commands

This commit is contained in:
Art4 2024-11-05 12:13:18 +00:00
parent 01ba276455
commit 4b971f84fd
3 changed files with 7 additions and 4 deletions

View file

@ -144,6 +144,8 @@ HELP;
} }
$this->out($table->getTable()); $this->out($table->getTable());
return 0;
} }
/** /**

View file

@ -158,9 +158,10 @@ HELP;
if ($result['success']) { if ($result['success']) {
$this->out('User ' . $user['nickname'] . ' now connected to ' . $url . ', contact ID ' . $result['cid']); $this->out('User ' . $user['nickname'] . ' now connected to ' . $url . ', contact ID ' . $result['cid']);
} else { return true;
throw new RuntimeException($result['message']);
} }
throw new RuntimeException($result['message']);
} }
/** /**

View file

@ -122,7 +122,7 @@ HELP;
case 'search': case 'search':
return $this->searchUser(); return $this->searchUser();
case 'config': case 'config':
return $this->configUser(); return ($this->configUser()) ? 0 : 1;
default: default:
throw new \Asika\SimpleConsole\CommandArgsException('Wrong command.'); throw new \Asika\SimpleConsole\CommandArgsException('Wrong command.');
} }
@ -513,6 +513,6 @@ HELP;
return false; return false;
} }
return false; return true;
} }
} }