Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wearerequired/coding-standards requirement from ^5.0 to ^6.0 #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.0"
coverage: none
tools: composer

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
}
],
"require": {
"php": ">=7.4"
"php": ">=8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0",
"wearerequired/coding-standards": "^5.0"
"wearerequired/coding-standards": "^6.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
8 changes: 4 additions & 4 deletions translations-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function site_status_test_apcu_php_module( array $modules ): array {
add_filter( 'site_status_test_php_modules', __NAMESPACE__ . '\site_status_test_apcu_php_module' );

// Bail early if APCu is not available.
if ( ! function_exists( 'apcu_enabled' ) || ! apcu_enabled() ) {
if ( ! \function_exists( 'apcu_enabled' ) || ! apcu_enabled() ) {
return;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ function load_textdomain( ?bool $loaded, string $domain, string $mofile, ?string
return true;
}

$wp_textdomain_registry->set( $domain, $locale, dirname( $mofile ) );
$wp_textdomain_registry->set( $domain, $locale, \dirname( $mofile ) );

// Cache the translations.
$data = [
Expand Down Expand Up @@ -172,7 +172,7 @@ function load_textdomain( ?bool $loaded, string $domain, string $mofile, ?string
* @return bool|array<string,mixed> Returns true if something has effectively been added into the cache,
* false otherwise. Second syntax returns array with error keys.
*/
function cache_add( string $key, $data, int $expire = 0 ) {
function cache_add( string $key, mixed $data, int $expire = 0 ): bool|array {
// Alter provided expire values to be within -10%/+20% of the provided time,
// to spread expires over a wider window.
$expire = rand( \intval( $expire * 0.9 ), \intval( $expire * 1.2 ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.rand_rand
Expand All @@ -188,6 +188,6 @@ function cache_add( string $key, $data, int $expire = 0 ) {
* Disambiguates a return of false, a storable value. Default null.
* @return mixed The stored variable or array of variables on success; false on failure.
*/
function cache_fetch( string $key, ?bool &$found = null ) {
function cache_fetch( string $key, ?bool &$found = null ): mixed {
return apcu_fetch( $key, $found );
}
Loading