From 8391b1dbc2c992ce1daa6b2623e0b50db755a1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Wed, 25 Sep 2024 11:03:05 +0200 Subject: [PATCH] fix return type of to_object of final event transformers --- includes/activitypub/transformer/class-events-manager.php | 2 +- includes/activitypub/transformer/class-gatherpress.php | 2 +- includes/activitypub/transformer/class-the-events-calendar.php | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/activitypub/transformer/class-events-manager.php b/includes/activitypub/transformer/class-events-manager.php index 4b1b198..5fed600 100644 --- a/includes/activitypub/transformer/class-events-manager.php +++ b/includes/activitypub/transformer/class-events-manager.php @@ -264,7 +264,7 @@ final class Events_Manager extends Event_Transformer { * * @return Activitypub\Activity\Event */ - public function to_object() { + public function to_object(): Event { $this->em_event = new EM_Event( $this->wp_object->ID, 'post_id' ); $activitypub_object = new Event(); diff --git a/includes/activitypub/transformer/class-gatherpress.php b/includes/activitypub/transformer/class-gatherpress.php index ab176c4..1bd9081 100644 --- a/includes/activitypub/transformer/class-gatherpress.php +++ b/includes/activitypub/transformer/class-gatherpress.php @@ -199,7 +199,7 @@ final class GatherPress extends Event { * * @return Activitypub\Activity\Event */ - public function to_object() { + public function to_object(): Event_Object { $activitypub_object = parent::to_object(); return $activitypub_object; diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index 6881271..7707ca8 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -14,6 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) { use Activitypub_Event_Extensions\Activitypub\Transformer\Event; use Activitypub\Activity\Extended_Object\Place; +use Activitypub\Activity\Extended_Object\Event as Event_Object; use WP_Error; use WP_Post; @@ -194,7 +195,7 @@ final class The_Events_Calendar extends Event { * * @return Event_Object */ - public function to_object() { + public function to_object(): Event_Object { $activitypub_object = parent::to_object(); return $activitypub_object;