From d42f83ea5b39287b46f896930c3b27883deb7de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Mon, 28 Oct 2024 15:01:39 +0100 Subject: [PATCH 1/5] add php 7.4 --- .forgejo/workflows/phpunit.yml | 2 +- README.md | 2 +- activitypub-event-bridge.php | 2 +- readme.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index a893dce..61b7867 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -21,7 +21,7 @@ jobs: MYSQL_ROOT_PASSWORD: root strategy: matrix: - php-version: ['8.1', '8.2', '8.3'] + php-version: ['7.4', '8.1', '8.2', '8.3'] name: PHPUnit – PHP ${{ matrix.php-version }} env: extensions: mysql diff --git a/README.md b/README.md index 07aceea..388b496 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Tags: events, fediverse, activitypub, calendar Requires at least: 6.5 Tested up to: 6.6 Stable tag: 0.1.0 -Requires PHP: 8.1 +Requires PHP: 7.4 License: AGPL-3.0-or-later License URI: https://www.gnu.org/licenses/agpl-3.0.html diff --git a/activitypub-event-bridge.php b/activitypub-event-bridge.php index b1cb2ea..4de5843 100644 --- a/activitypub-event-bridge.php +++ b/activitypub-event-bridge.php @@ -9,7 +9,7 @@ * Text Domain: activitypub-event-bridge * License: AGPL-3.0-or-later * License URI: https://www.gnu.org/licenses/agpl-3.0.de.html - * Requires PHP: 8.1 + * Requires PHP: 7.4 * * Requires at least ActivityPub plugin with version >= 3.2.2. ActivityPub plugin tested up to: 3.3.3. * diff --git a/readme.txt b/readme.txt index d0b9c7e..ec7b1f2 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: events, fediverse, activitypub, calendar Requires at least: 6.5 Tested up to: 6.6 Stable tag: 0.1.0 -Requires PHP: 8.1 +Requires PHP: 7.4 License: AGPL-3.0-or-later License URI: https://www.gnu.org/licenses/agpl-3.0.html Integrating popular event plugins with the ActivityPub plugin. -- 2.39.5 From 0057c3ddcc2352557b045682546561fabc9c1f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Mon, 28 Oct 2024 15:04:19 +0100 Subject: [PATCH 2/5] fix composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6236dfc..4da8b48 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "The ActivityPub Event Bridge help for event custom post types to federate properly.", "type": "wordpress-plugin", "require": { - "php": ">=8.1.0", + "php": ">=7.4.0", "composer/installers": "^2.0" }, "require-dev": { -- 2.39.5 From 60d9aa909f33d8a13de3b9822b2edfd42b1d73a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 31 Oct 2024 15:42:23 +0100 Subject: [PATCH 3/5] update compose cache for php 7.4. compatibility --- .forgejo/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index 61b7867..7e24b23 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -45,7 +45,7 @@ jobs: with: path: | ./vendor/ - key: cache-composer-phpunit-1 + key: cache-composer-phpunit-2 - name: Setup PHP uses: https://github.com/shivammathur/setup-php@v2 -- 2.39.5 From b1f41cc1244cdb932e5bd9a99c28a44615df375b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 31 Oct 2024 16:24:57 +0100 Subject: [PATCH 4/5] adjust return typo syntax for php7.4 --- .../activitypub/transformer/class-the-events-calendar.php | 4 ++-- includes/class-setup.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index 2fe7274..f50fa29 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -121,9 +121,9 @@ final class The_Events_Calendar extends Event { /** * Get the event location. * - * @return Place|array The place/venue if one is set. + * @return ?Place The place/venue if one is set. */ - public function get_location(): Place|null { + public function get_location(): ?Place { // Get short handle for the venues. $venues = $this->tribe_event->venues; diff --git a/includes/class-setup.php b/includes/class-setup.php index 966d1d3..2912002 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -252,7 +252,7 @@ class Setup { * * @return \Activitypub\Transformer\Base|null */ - public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): \Activitypub\Transformer\Base|null { + public function register_activitypub_event_transformer( $transformer, $wp_object, $object_class ): \Activitypub\Transformer\Base { // If the current WordPress object is not a post (e.g., a WP_Comment), don't change the transformer. if ( 'WP_Post' !== $object_class ) { return $transformer; -- 2.39.5 From 97d04c2e47592ab2dc9ed555d3a3278cf9871267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 31 Oct 2024 16:28:23 +0100 Subject: [PATCH 5/5] also add php8.0 to unit tests --- .forgejo/workflows/phpunit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/phpunit.yml b/.forgejo/workflows/phpunit.yml index 7e24b23..3e6d9f7 100644 --- a/.forgejo/workflows/phpunit.yml +++ b/.forgejo/workflows/phpunit.yml @@ -21,7 +21,7 @@ jobs: MYSQL_ROOT_PASSWORD: root strategy: matrix: - php-version: ['7.4', '8.1', '8.2', '8.3'] + php-version: ['7.4', '8.0', '8.1', '8.2', '8.3'] name: PHPUnit – PHP ${{ matrix.php-version }} env: extensions: mysql -- 2.39.5