]> git.mxchange.org Git - friendica.git/commitdiff
Fix returns in Console commands
authorArt4 <art4@wlabs.de>
Tue, 5 Nov 2024 12:13:18 +0000 (12:13 +0000)
committerArt4 <art4@wlabs.de>
Tue, 5 Nov 2024 12:13:18 +0000 (12:13 +0000)
src/Console/Addon.php
src/Console/Contact.php
src/Console/User.php

index fd2093f9f5182d74d9141efbe3bc7ad2d264934d..43ce7a6be3363dd892dd4494389a818f0422f2d7 100644 (file)
@@ -144,6 +144,8 @@ HELP;
 
                }
                $this->out($table->getTable());
+
+               return 0;
        }
 
        /**
index e02f5897140bcdbf030a04223e2d5955f695b106..46a26c4a9d3ebac47041bb2264bb9c04d6a13092 100644 (file)
@@ -158,9 +158,10 @@ HELP;
 
                if ($result['success']) {
                        $this->out('User ' . $user['nickname'] . ' now connected to ' . $url . ', contact ID ' . $result['cid']);
-               } else {
-                       throw new RuntimeException($result['message']);
+                       return true;
                }
+
+               throw new RuntimeException($result['message']);
        }
 
        /**
index b73311368ab43977a150f23ba0ba7e39f3b22749..42e85f007d7e85acfc8e216b778a97f55f3c3576 100644 (file)
@@ -122,7 +122,7 @@ HELP;
                        case 'search':
                                return $this->searchUser();
                        case 'config':
-                               return $this->configUser();
+                               return ($this->configUser()) ? 0 : 1;
                        default:
                                throw new \Asika\SimpleConsole\CommandArgsException('Wrong command.');
                }
@@ -513,6 +513,6 @@ HELP;
                                return false;
                }
 
-               return false;
+               return true;
        }
 }