X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FUser.php;h=93b24cbc6a23cc1895b904e64d995b82d8009078;hb=9581b05603e6ee4e250738c159ed2e67b3fb2eeb;hp=383a77f70ebc805ae80d4fc2aa6891aab140af4b;hpb=ac4f62f55698b2851169b0ac0bfa7c9616222dfe;p=friendica.git diff --git a/src/Console/User.php b/src/Console/User.php index 383a77f70e..93b24cbc6a 100644 --- a/src/Console/User.php +++ b/src/Console/User.php @@ -1,6 +1,6 @@ pConfig = $pConfig; } - protected function doExecute() + protected function doExecute(): int { if ($this->getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -178,7 +178,7 @@ HELP; $nick = $this->getNick($arg_index); $user = UserModel::getByNickname($nick, ['uid']); - if (!$user) { + if (empty($user)) { throw new RuntimeException($this->l10n->t('User not found')); } @@ -206,7 +206,7 @@ HELP; try { $result = UserModel::updatePassword($user['uid'], $password); - if (!$result) { + if (empty($result)) { throw new \Exception($this->l10n->t('Password update failed. Please try again.')); } @@ -310,7 +310,7 @@ HELP; * @return bool True, if the delete was successful * @throws \Exception */ - private function deleteUser() + private function deleteUser(): bool { $user = $this->getUserByNick(1); @@ -370,7 +370,7 @@ HELP; $contact['url'], $contact['email'], Temporal::getRelativeDate($contact['created']), - Temporal::getRelativeDate($contact['login_date']), + Temporal::getRelativeDate($contact['last-activity']), Temporal::getRelativeDate($contact['last-item']), ]); } @@ -396,7 +396,7 @@ HELP; 'nickname', 'email', 'register_date', - 'login_date', + 'last-activity', 'verified', 'blocked', ]; @@ -425,7 +425,7 @@ HELP; return false; } - if ($user) { + if (!empty($user)) { $table->addRow($user); } $this->out($table->getTable());