]> git.mxchange.org Git - friendica.git/commitdiff
Correct format/style errors
authorHank Grabowski <hankgrabowski@gmail.com>
Tue, 28 Feb 2023 16:41:53 +0000 (11:41 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Tue, 28 Feb 2023 16:41:53 +0000 (11:41 -0500)
src/Module/BaseApi.php
src/Object/Api/Mastodon/Status/FriendicaExtension.php
src/Object/Api/Mastodon/TimelineOrderByTypes.php

index 4c16ab20e29609ce7b88ff6cfef872e50a21ab30..8b79aff49152cb515b721dafdecac40ed2c44cf0 100644 (file)
@@ -189,32 +189,41 @@ class BaseApi extends BaseModule
                return $params;
        }
 
-       protected function updateBoundaries(Status $status, array $post_item, string $order) {
-               ;
+       /**
+        * Update the ID/time boundaries for this result set. Used for building Link Headers
+        *
+        * @param Status $status
+        * @param array $post_item
+        * @param string $order
+        * @return void
+        * @throws \Exception
+        */
+       protected function updateBoundaries(Status $status, array $post_item, string $order)
+       {
                try {
                        switch ($order) {
                                case TimelineOrderByTypes::CHANGED:
-                                       if (!empty($status->friendicaExtension()->changedAt())){
+                                       if (!empty($status->friendicaExtension()->changedAt())) {
                                                self::setBoundaries(new DateTime(DateTimeFormat::utc($status->friendicaExtension()->changedAt(), DateTimeFormat::JSON)));
                                        }
                                        break;
                                case TimelineOrderByTypes::CREATED:
-                                       if (!empty($status->createdAt())){
+                                       if (!empty($status->createdAt())) {
                                                self::setBoundaries(new DateTime(DateTimeFormat::utc($status->createdAt(), DateTimeFormat::JSON)));
                                        }
                                        break;
                                case TimelineOrderByTypes::COMMENTED:
-                                       if (!empty($status->friendicaExtension()->commentedAt())){
+                                       if (!empty($status->friendicaExtension()->commentedAt())) {
                                                self::setBoundaries(new DateTime(DateTimeFormat::utc($status->friendicaExtension()->commentedAt(), DateTimeFormat::JSON)));
                                        }
                                        break;
                                case TimelineOrderByTypes::EDITED:
-                                       if (!empty($status->friendicaExtension()->editedAt())){
+                                       if (!empty($status->friendicaExtension()->editedAt())) {
                                                self::setBoundaries(new DateTime(DateTimeFormat::utc($status->friendicaExtension()->editedAt(), DateTimeFormat::JSON)));
                                        }
                                        break;
                                case TimelineOrderByTypes::RECEIVED:
-                                       if (!empty($status->friendicaExtension()->receivedAt())){
+                                       if (!empty($status->friendicaExtension()->receivedAt())) {
                                                self::setBoundaries(new DateTime(DateTimeFormat::utc($status->friendicaExtension()->receivedAt(), DateTimeFormat::JSON)));
                                        }
                                        break;
index 3e39c2baa6912ab4311514b215d4bfd7e87bcf41..b6dcd5df0c34109acaa44e5865f740bcbd702455 100644 (file)
@@ -52,16 +52,27 @@ class FriendicaExtension extends BaseDataTransferObject
        /** @var int */
        protected $dislikes_count;
 
+
        /**
         * Creates a status count object
         *
         * @param string $title
+        * @param string|null $changed_at
+        * @param string|null $commented_at
+        * @param string|null $edited_at
+        * @param string|null $received_at
         * @param int $dislikes_count
         * @param FriendicaDeliveryData $delivery_data
         */
-       public function __construct(string $title, ?string $changed_at, ?string $commented_at, ?string $edited_at, ?string $received_at,
-                                                               int $dislikes_count, FriendicaDeliveryData $delivery_data)
-       {
+       public function __construct(
+               string $title,
+               ?string $changed_at,
+               ?string $commented_at,
+               ?string $edited_at,
+               ?string $received_at,
+               int $dislikes_count,
+               FriendicaDeliveryData $delivery_data
+       ) {
                $this->title          = $title;
                $this->changed_at     = $changed_at;
                $this->commented_at   = $commented_at;
@@ -106,5 +117,4 @@ class FriendicaExtension extends BaseDataTransferObject
        {
                return $this->received_at;
        }
-
 }
index 04fb7cc3b845dce3678bb536d33bfce87a295ca5..d50f389bf01b4b1cbde13fdb68c6ec19fb20f97f 100644 (file)
@@ -38,5 +38,4 @@ abstract class TimelineOrderByTypes
        const ID        = 'id';
 
        const RECEIVED  = 'received';
-
 }