]> git.mxchange.org Git - friendica.git/commitdiff
Use selectToArray() instead of select() and is_iterable()
authorArt4 <art4@wlabs.de>
Thu, 27 Feb 2025 12:47:25 +0000 (12:47 +0000)
committerArt4 <art4@wlabs.de>
Thu, 27 Feb 2025 12:47:25 +0000 (12:47 +0000)
src/Module/Api/Twitter/Lists/Ownership.php

index 0b18f6bc18d804cbe4d34aec641852efd724ae06..bea9367a6df5b96e4ff825309559b4b7884d1a73 100644 (file)
@@ -44,15 +44,13 @@ class Ownership extends BaseApi
                $this->checkAllowedScope(BaseApi::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
 
-               $circles = $this->dba->select('group', [], ['deleted' => false, 'uid' => $uid, 'cid' => null]);
+               $circles = $this->dba->selectToArray('group', [], ['deleted' => false, 'uid' => $uid, 'cid' => null]);
 
                // loop through all circles
                $lists = [];
 
-               if (is_iterable($circles)) {
-                       foreach ($circles as $circle) {
-                               $lists[] = $this->friendicaCircle->createFromId($circle['id']);
-                       }
+               foreach ($circles as $circle) {
+                       $lists[] = $this->friendicaCircle->createFromId($circle['id']);
                }
 
                $this->response->addFormattedContent('statuses', ['lists' => ['lists' => $lists]], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));