]> git.mxchange.org Git - friendica.git/commitdiff
Superflous spaces
authorMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 07:14:09 +0000 (07:14 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 07:14:09 +0000 (07:14 +0000)
src/Module/Api/Friendica/Group/Create.php
src/Module/Api/Friendica/Group/Delete.php
src/Module/Api/Friendica/Group/Show.php
src/Module/Api/Twitter/Lists/Create.php
src/Module/Api/Twitter/Lists/Destroy.php
src/Module/Api/Twitter/Lists/Ownership.php
src/Module/Api/Twitter/Lists/Statuses.php
src/Module/Api/Twitter/Lists/Update.php

index 85445588be06dd0a1fc1d82393e55ff7664375ad..be85146f4d4c34c450d571d51cf4fe5654b36a42 100644 (file)
@@ -35,27 +35,27 @@ class Create extends BaseApi
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
                $uid = BaseApi::getCurrentUserID();
-       
+
                // params
                $name = $_REQUEST['name'] ?? '';
                $json = json_decode($_POST['json'], true);
                $users = $json['user'];
-       
+
                // error if no name specified
                if ($name == '') {
                        throw new HTTPException\BadRequestException('group name not specified');
                }
-       
+
                // error message if specified group name already exists
                if (DBA::exists('group', ['uid' => $uid, 'name' => $name, 'deleted' => false])) {
                        throw new HTTPException\BadRequestException('group name already exists');
                }
-       
+
                // Check if the group needs to be reactivated
                if (DBA::exists('group', ['uid' => $uid, 'name' => $name, 'deleted' => true])) {
                        $reactivate_group = true;
                }
-       
+
                // create group
                $ret = Group::create($uid, $name);
                if ($ret) {
@@ -63,7 +63,7 @@ class Create extends BaseApi
                } else {
                        throw new HTTPException\BadRequestException('other API error');
                }
-       
+
                // add members
                $erroraddinguser = false;
                $errorusers = [];
@@ -76,12 +76,12 @@ class Create extends BaseApi
                                $errorusers[] = $cid;
                        }
                }
-       
+
                // return success message incl. missing users in array
                $status = ($erroraddinguser ? 'missing user' : ((isset($reactivate_group) && $reactivate_group) ? 'reactivated' : 'ok'));
-       
+
                $result = ['success' => true, 'gid' => $gid, 'name' => $name, 'status' => $status, 'wrong users' => $errorusers];
-               
+
                $this->response->exit('group_create', ['$result' => $result], $this->parameters['extension'] ?? null);
        }
 }
index e845bd7a73ad76d69881f1b6292f85b28c0ab08c..d48e9a4f9d49566c3cb0d8453d3ebab07ccad5b0 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Module\Api\Friendica\Group;
 
 use Friendica\Database\DBA;
-use Friendica\DI;
 use Friendica\Model\Group;
 use Friendica\Module\BaseApi;
 use Friendica\Network\HTTPException\BadRequestException;
index 62e13e08b6f05479bcff895ada3b1e38495c6e8a..3ec2b762543118f7f56c11aea9a2eceee33f4edd 100644 (file)
@@ -37,14 +37,14 @@ class Show extends BaseApi
                BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
                $uid  = BaseApi::getCurrentUserID();
                $type = $this->parameters['extension'] ?? '';
-       
+
                // params
                $gid = $_REQUEST['gid'] ?? 0;
-       
+
                // get data of the specified group id or all groups if not specified
                if ($gid != 0) {
                        $groups = DBA::selectToArray('group', [], ['deleted' => false, 'uid' => $uid, 'id' => $gid]);
-       
+
                        // error message if specified gid is not in database
                        if (!DBA::isResult($groups)) {
                                throw new HTTPException\BadRequestException('gid not available');
@@ -52,13 +52,13 @@ class Show extends BaseApi
                } else {
                        $groups = DBA::selectToArray('group', [], ['deleted' => false, 'uid' => $uid]);
                }
-       
+
                // loop through all groups and retrieve all members for adding data in the user array
                $grps = [];
                foreach ($groups as $rr) {
                        $members = Contact\Group::getById($rr['id']);
                        $users = [];
-       
+
                        if ($type == 'xml') {
                                $user_element = 'users';
                                $k = 0;
index 746f71d0f38d7e97474e2e6db7d1e53dffcc4e4c..80071c30e245ffa2aa3ce6e8474e7c3d632e9baa 100644 (file)
@@ -53,33 +53,33 @@ class Create extends BaseApi
                $this->dba = $dba;
                $this->friendicaGroup = $friendicaGroup;
        }
-       
+
        protected function rawContent(array $request = [])
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
                $uid = BaseApi::getCurrentUserID();
-       
+
                // params
                $name = $_REQUEST['name'] ?? '';
-       
+
                if ($name == '') {
                        throw new HTTPException\BadRequestException('group name not specified');
                }
-       
+
                // error message if specified group name already exists
                if ($this->dba->exists('group', ['uid' => $uid, 'name' => $name, 'deleted' => false])) {
                        throw new HTTPException\BadRequestException('group name already exists');
                }
-       
+
                $ret = Group::create($uid, $name);
                if ($ret) {
                        $gid = Group::getIdByName($uid, $name);
                } else {
                        throw new HTTPException\BadRequestException('other API error');
                }
-       
+
                $grp = $this->friendicaGroup->createFromId($gid);
-       
+
                $this->response->exit('statuses', ['lists' => ['lists' => $grp]], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));
        }
 }
index ee2ac2d3cbd139fb83c0fd69841a85d5f0edc733..06ca9a73dca89a8955365ac54fd111031cd6be3f 100644 (file)
@@ -53,29 +53,29 @@ class Destroy extends BaseApi
                $this->dba = $dba;
                $this->friendicaGroup = $friendicaGroup;
        }
-       
+
        protected function rawContent(array $request = [])
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
                $uid = BaseApi::getCurrentUserID();
-       
+
                // params
                $gid = $_REQUEST['list_id'] ?? 0;
-       
+
                // error if no gid specified
                if ($gid == 0) {
                        throw new HTTPException\BadRequestException('gid not specified');
                }
-       
+
                // get data of the specified group id
                $group = $this->dba->selectFirst('group', [], ['uid' => $uid, 'id' => $gid]);
                // error message if specified gid is not in database
                if (!$group) {
                        throw new HTTPException\BadRequestException('gid not available');
                }
-       
+
                $list = $this->friendicaGroup->createFromId($gid);
-       
+
                if (Group::remove($gid)) {
                        $this->response->exit('statuses', ['lists' => ['lists' => $list]], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));
                }
index 436097970d4c37c4924593d5d7c1efde9bc6c2b3..e94a07823195360ef12f0e84399735bc3e0746a5 100644 (file)
@@ -55,9 +55,9 @@ class Ownership extends BaseApi
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
-       
+
                $groups = $this->dba->select('group', [], ['deleted' => false, 'uid' => $uid]);
-       
+
                // loop through all groups
                $lists = [];
                foreach ($groups as $group) {
index 257d6bc5138cf4b4d5bce930d46c3384a650f165..5da93740a0a5b3ee080c9a6d6013cd253e0d5766 100644 (file)
@@ -54,7 +54,7 @@ class Statuses extends BaseApi
                $this->dba = $dba;
                $this->twitterStatus = $twitterStatus;
        }
-       
+
        protected function rawContent(array $request = [])
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
index 95fe90d0acbb9a7396dfb0b547b9414943d124eb..d670c3a6d4f3a8672c07b424e83c0e59d2892cee 100644 (file)
@@ -58,26 +58,26 @@ class Update extends BaseApi
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
                $uid = BaseApi::getCurrentUserID();
-       
+
                // params
                $gid  = $_REQUEST['list_id'] ?? 0;
                $name = $_REQUEST['name'] ?? '';
-       
+
                // error if no gid specified
                if ($gid == 0) {
                        throw new HTTPException\BadRequestException('gid not specified');
                }
-       
+
                // get data of the specified group id
                $group = $this->dba->selectFirst('group', [], ['uid' => $uid, 'id' => $gid]);
                // error message if specified gid is not in database
                if (!$group) {
                        throw new HTTPException\BadRequestException('gid not available');
                }
-       
+
                if (Group::update($gid, $name)) {
                        $list = $this->friendicaGroup->createFromId($gid);
-       
+
                        $this->response->exit('statuses', ['lists' => ['lists' => $list]], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));
                }
        }