]> git.mxchange.org Git - friendica.git/commitdiff
Check return values with empty()
authorMatthew Exon <git.mexon@spamgourmet.com>
Sun, 2 May 2021 16:12:53 +0000 (18:12 +0200)
committerMatthew Exon <git.mexon@spamgourmet.com>
Sun, 2 May 2021 18:05:07 +0000 (20:05 +0200)
src/Console/User.php

index 383a77f70ebc805ae80d4fc2aa6891aab140af4b..bb0748d6f6f705bfcdb79568e64a3505a7f58d96 100644 (file)
@@ -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.'));
                        }
 
@@ -425,7 +425,7 @@ HELP;
                                return false;
                }
 
-               if ($user) {
+               if (!empty($user)) {
                        $table->addRow($user);
                }
                $this->out($table->getTable());