]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Api/Twitter/Favorites.php
Some more standards
[friendica.git] / src / Module / Api / Twitter / Favorites.php
index 62b86c21e839fa93e58514c052fe2b8bb1b1a19a..6a901574e57a849b405ee63f24a51be96b1c12b9 100644 (file)
@@ -39,39 +39,39 @@ class Favorites extends BaseApi
        {
                BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
-       
+
                // in friendica starred item are private
                // return favorites only for self
                Logger::info(API_LOG_PREFIX . 'for {self}', ['module' => 'api', 'action' => 'favorites']);
-       
+
                // params
                $since_id = $_REQUEST['since_id'] ?? 0;
-               $max_id = $_REQUEST['max_id'] ?? 0;
-               $count = $_GET['count'] ?? 20;
-               $page = $_REQUEST['page'] ?? 1;
-       
+               $max_id   = $_REQUEST['max_id']   ?? 0;
+               $count    = $_GET['count']        ?? 20;
+               $page     = $_REQUEST['page']     ?? 1;
+
                $start = max(0, ($page - 1) * $count);
-       
+
                $condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `id` > ? AND `starred`",
                        $uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id];
-       
+
                $params = ['order' => ['id' => true], 'limit' => [$start, $count]];
-       
+
                if ($max_id > 0) {
                        $condition[0] .= " AND `id` <= ?";
                        $condition[] = $max_id;
                }
-       
+
                $statuses = Post::selectForUser($uid, [], $condition, $params);
-       
+
                $include_entities = strtolower(($_REQUEST['include_entities'] ?? 'false') == 'true');
-       
+
                $ret = [];
                while ($status = DBA::fetch($statuses)) {
                        $ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
                }
                DBA::close($statuses);
-       
+
                DI::apiResponse()->exit('statuses', ['status' => $ret], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));
        }
 }