Skip to content

Commit

Permalink
Bump to PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed May 16, 2024
1 parent 1830a06 commit 47a8cf3
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 34 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion inc/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion inc/WebhookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion inc/WebhookHandler/Bitbucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion inc/WebhookHandler/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion inc/WebhookHandler/GitLab.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/Repository/Bitbucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/Repository/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/Repository/GitLab.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion traduttore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected])
*
Expand Down

0 comments on commit 47a8cf3

Please sign in to comment.