diff --git a/.github/workflows/behat.yml b/.github/workflows/behat.yml index 571e0c7..b508c99 100644 --- a/.github/workflows/behat.yml +++ b/.github/workflows/behat.yml @@ -32,21 +32,11 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - php: [ '7.4' ] + php: [ '8.1' ] wordpress: [ 'latest' ] glotpress: [ 'latest' ] experimental: [ false ] include: - - os: ubuntu-latest - php: '8.0' - wordpress: 'latest' - glotpress: 'latest' - experimental: false - - os: ubuntu-latest - php: '8.1' - wordpress: 'latest' - glotpress: 'latest' - experimental: false - os: ubuntu-latest php: '8.2' wordpress: 'latest' @@ -63,6 +53,11 @@ jobs: wordpress: 'nightly' glotpress: 'develop' experimental: true + - os: ubuntu-latest + php: '8.4' + wordpress: 'nightly' + glotpress: 'develop' + experimental: true steps: - name: Check out Git repository diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 331f30e..481536a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,7 +18,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: "7.4" + php-version: latest coverage: none tools: composer, cs2pr diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index eaf145a..56a08e5 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -28,21 +28,11 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - php: [ '7.4' ] + php: [ '8.1' ] wordpress: [ 'latest' ] glotpress: [ 'latest' ] experimental: [ false ] include: - - os: ubuntu-latest - php: '8.0' - wordpress: 'latest' - glotpress: 'latest' - experimental: false - - os: ubuntu-latest - php: '8.1' - wordpress: 'latest' - glotpress: 'latest' - experimental: false - os: ubuntu-latest php: '8.2' wordpress: 'latest' @@ -59,6 +49,11 @@ jobs: wordpress: 'nightly' glotpress: 'develop' experimental: true + - os: ubuntu-latest + php: '8.4' + wordpress: 'nightly' + glotpress: 'develop' + experimental: true steps: - name: Check out Git repository diff --git a/CHANGELOG.md b/CHANGELOG.md index 62ce774..6d9a92f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed * Require GlotPress 4.0. [#270] -* Require at least PHP 7.4. [#270] +* Require at least PHP 8.1. [#270] ### Fixed * Pass correct parameter for translation set in `traduttore.generate_zip_delay` filter. [#236] diff --git a/composer.json b/composer.json index fff916e..8d508c4 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "issues": "https://github.com/wearerequired/traduttore/issues" }, "require": { - "php": ">=7.4", + "php": ">=8.1", "ext-json": "*", "ext-zip": "*", "wearerequired/traduttore-registry": "^2.0" diff --git a/inc/Plugin.php b/inc/Plugin.php index d9dbc0b..8babe7a 100644 --- a/inc/Plugin.php +++ b/inc/Plugin.php @@ -419,7 +419,7 @@ public function incoming_webhook_permission_callback( WP_REST_Request $request ) * @param \Required\Traduttore\WebhookHandler|null $handler The current webhook handler if found. * @param \WP_REST_Request $request The current request. */ - return apply_filters( 'traduttore.incoming_webhook_permission_callback', (bool) $result, $handler, $request ); + return apply_filters( 'traduttore.incoming_webhook_permission_callback', $result, $handler, $request ); } /** diff --git a/inc/WebhookHandler.php b/inc/WebhookHandler.php index b75b2ee..055eb00 100644 --- a/inc/WebhookHandler.php +++ b/inc/WebhookHandler.php @@ -33,7 +33,7 @@ public function __construct( WP_REST_Request $request ); * * @return bool True if permission is granted, false otherwise. */ - public function permission_callback(): ?bool; + public function permission_callback(): bool; /** * Callback for incoming webhooks. diff --git a/inc/WebhookHandler/Bitbucket.php b/inc/WebhookHandler/Bitbucket.php index 33fec60..9d5c252 100644 --- a/inc/WebhookHandler/Bitbucket.php +++ b/inc/WebhookHandler/Bitbucket.php @@ -27,7 +27,7 @@ class Bitbucket extends Base { * * @return bool True if permission is granted, false otherwise. */ - public function permission_callback(): ?bool { + public function permission_callback(): bool { $event_name = $this->request->get_header( 'x-event-key' ); if ( 'repo:push' !== $event_name ) { diff --git a/inc/WebhookHandler/GitHub.php b/inc/WebhookHandler/GitHub.php index 7d548e4..6e5db54 100644 --- a/inc/WebhookHandler/GitHub.php +++ b/inc/WebhookHandler/GitHub.php @@ -27,7 +27,7 @@ class GitHub extends Base { * * @return bool True if permission is granted, false otherwise. */ - public function permission_callback(): ?bool { + public function permission_callback(): bool { $event_name = $this->request->get_header( 'x-github-event' ); if ( 'ping' === $event_name ) { diff --git a/inc/WebhookHandler/GitLab.php b/inc/WebhookHandler/GitLab.php index 69c65ee..4ef4780 100644 --- a/inc/WebhookHandler/GitLab.php +++ b/inc/WebhookHandler/GitLab.php @@ -27,7 +27,7 @@ class GitLab extends Base { * * @return bool True if permission is granted, false otherwise. */ - public function permission_callback(): ?bool { + public function permission_callback(): bool { $event_name = $this->request->get_header( 'x-gitlab-event' ); if ( 'Push Hook' !== $event_name ) { diff --git a/tests/phpunit/tests/Repository/Bitbucket.php b/tests/phpunit/tests/Repository/Bitbucket.php index 7213401..9cfdc3f 100644 --- a/tests/phpunit/tests/Repository/Bitbucket.php +++ b/tests/phpunit/tests/Repository/Bitbucket.php @@ -88,7 +88,7 @@ public function test_get_name(): void { * @param string $url The request URL. * @return array{response: array{ code: int }, body: string}|false Response data. */ - public function mock_repository_visibility_request( false $preempt, mixed $r, string $url ): array|false { + public function mock_repository_visibility_request( bool $preempt, mixed $r, string $url ): array|false { if ( BitbucketRepository::API_BASE . '/repositories/wearerequired/traduttore' === $url ) { ++$this->http_request_count; diff --git a/tests/phpunit/tests/Repository/GitHub.php b/tests/phpunit/tests/Repository/GitHub.php index eb14bf2..41bd894 100644 --- a/tests/phpunit/tests/Repository/GitHub.php +++ b/tests/phpunit/tests/Repository/GitHub.php @@ -103,7 +103,7 @@ public function test_get_name(): void { * @param string $url The request URL. * @return array{response: array{ code: int }, body: string}|false Response data. */ - public function mock_repository_visibility_request( false $preempt, mixed $r, string $url ): array|false { + public function mock_repository_visibility_request( bool $preempt, mixed $r, string $url ): array|false { if ( GitHubRepository::API_BASE . '/repos/wearerequired/traduttore' === $url ) { ++$this->http_request_count; diff --git a/tests/phpunit/tests/Repository/GitLab.php b/tests/phpunit/tests/Repository/GitLab.php index 0e0eed6..5d0865f 100644 --- a/tests/phpunit/tests/Repository/GitLab.php +++ b/tests/phpunit/tests/Repository/GitLab.php @@ -102,7 +102,7 @@ public function test_get_host(): void { * @param string $url The request URL. * @return array{response: array{ code: int }, body: string}|false Response data. */ - public function mock_repository_visibility_request( false $preempt, mixed $r, string $url ): array|false { + public function mock_repository_visibility_request( bool $preempt, mixed $r, string $url ): array|false { if ( GitLabRepository::API_BASE . '/projects/wearerequired%2Ftraduttore' === $url ) { ++$this->http_request_count; diff --git a/traduttore.php b/traduttore.php index 5b76ace..b9cc973 100644 --- a/traduttore.php +++ b/traduttore.php @@ -11,7 +11,8 @@ * Text Domain: traduttore * Domain Path: /languages * Update URI: false - * Requires PHP: 7.4 + * Requires PHP: 8.1 + * Requires Plugins: glotpress * * Copyright (c) 2017-2022 required (email: info@required.ch) *