diff --git a/.circleci/config.yml b/.circleci/config.yml index d73a11a..ab7dece 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: lint: working_directory: ~/pantheon-systems/wp-redis docker: - - image: quay.io/pantheon-public/build-tools-ci:8.x-php8.2 + - image: quay.io/pantheon-public/build-tools-ci:8.x-php8.0 steps: - checkout - restore_cache: diff --git a/bin/behat-prepare.sh b/bin/behat-prepare.sh index c709670..71d377c 100755 --- a/bin/behat-prepare.sh +++ b/bin/behat-prepare.sh @@ -86,9 +86,10 @@ terminus build:workflow:wait $TERMINUS_SITE.$TERMINUS_ENV ### # Set up WordPress, theme, and plugins for the test run ### +echo "Installing WordPress..." # Silence output so as not to show the password. { - terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=wp-redis@getpantheon.com --admin_password=$WORDPRESS_ADMIN_PASSWORD + terminus wp $SITE_ENV -- core install --title=$TERMINUS_ENV-$TERMINUS_SITE --url=$PANTHEON_SITE_URL --admin_user=$WORDPRESS_ADMIN_USERNAME --admin_email=wp-redis@getpantheon.com --admin_password=$WORDPRESS_ADMIN_PASSWORD } &> /dev/null echo "Flush cache and setup environment..." diff --git a/cli.php b/cli.php index fa94e67..bfb2e03 100644 --- a/cli.php +++ b/cli.php @@ -1,7 +1,10 @@ $_SERVER['CACHE_HOST'], - 'port' => $_SERVER['CACHE_PORT'], - 'auth' => $_SERVER['CACHE_PASSWORD'], - 'database' => isset( $_SERVER['CACHE_DB'] ) ? $_SERVER['CACHE_DB'] : 0, - ); + // Attempt to automatically load Pantheon's Redis config from the env. + if ( isset( $_SERVER['CACHE_HOST'] ) && isset( $_SERVER['CACHE_PORT'] ) && isset( $_SERVER['CACHE_PASSWORD'] ) && isset( $_SERVER['CACHE_DB'] ) ) { + $redis_server = [ + 'host' => sanitize_text_field( $_SERVER['CACHE_HOST'] ), + 'port' => sanitize_text_field( $_SERVER['CACHE_PORT'] ), + 'auth' => sanitize_text_field( $_SERVER['CACHE_PASSWORD'] ), + 'database' => sanitize_text_field( $_SERVER['CACHE_DB'] ), + ]; } else { - $redis_server = array( - 'host' => '127.0.0.1', - 'port' => 6379, - 'auth' => '', + $redis_server = [ + 'host' => '127.0.0.1', + 'port' => 6379, + 'auth' => '', 'database' => 0, - ); + ]; } } @@ -34,9 +37,10 @@ public function cli() { $redis_server['database'] = 0; } - $cmd = WP_CLI\Utils\esc_cmd( 'redis-cli -h %s -p %s -a %s -n %s', $redis_server['host'], $redis_server['port'], $redis_server['auth'], $redis_server['database'] ); - $process = WP_CLI\Utils\proc_open_compat( $cmd, array( STDIN, STDOUT, STDERR ), $pipes ); - $r = proc_close( $process ); + $pipes = null; + $cmd = WP_CLI\Utils\esc_cmd( 'redis-cli -h %s -p %s -a %s -n %s', $redis_server['host'], $redis_server['port'], $redis_server['auth'], $redis_server['database'] ); + $process = WP_CLI\Utils\proc_open_compat( $cmd, [ STDIN, STDOUT, STDERR ], $pipes ); + $r = proc_close( $process ); exit( (int) $r ); } @@ -56,11 +60,11 @@ public function cli() { public function debug( $_, $assoc_args ) { global $wp_object_cache; $this->load_wordpress_with_template(); - $data = array( + $data = [ 'cache_hits' => $wp_object_cache->cache_hits, 'cache_misses' => $wp_object_cache->cache_misses, 'redis_calls' => $wp_object_cache->redis_calls, - ); + ]; WP_CLI::print_value( $data, $assoc_args ); } @@ -134,14 +138,14 @@ public function enable() { * Success: Redis stats reset. */ public function info( $_, $assoc_args ) { - global $wp_object_cache, $redis_server; + global $wp_object_cache; if ( ! defined( 'WP_REDIS_OBJECT_CACHE' ) || ! WP_REDIS_OBJECT_CACHE ) { WP_CLI::error( 'WP Redis object-cache.php file is missing from the wp-content/ directory.' ); } if ( $wp_object_cache->is_redis_connected && WP_CLI\Utils\get_flag_value( $assoc_args, 'reset' ) ) { - // Redis::resetStat() isn't functional, see https://github.com/phpredis/phpredis/issues/928 + // Redis::resetStat() isn't functional, see https://github.com/phpredis/phpredis/issues/928. if ( $wp_object_cache->redis->eval( "return redis.call('CONFIG','RESETSTAT')" ) ) { WP_CLI::success( 'Redis stats reset.' ); } else { @@ -168,7 +172,7 @@ private function load_wordpress_with_template() { // Set up the main WordPress query. wp(); - $interpreted = array(); + $interpreted = []; foreach ( $wp_query as $key => $value ) { if ( 0 === stripos( $key, 'is_' ) && $value ) { $interpreted[] = $key; @@ -188,7 +192,7 @@ function( $template ) { 999 ); - // Template is normally loaded in global scope, so we need to replicate + // Template is normally loaded in global scope, so we need to replicate. foreach ( $GLOBALS as $key => $value ) { // phpcs:ignore PHPCompatibility.Variables.ForbiddenGlobalVariableVariable.NonBareVariableFound global $$key; @@ -196,7 +200,7 @@ function( $template ) { // Load the theme template. ob_start(); - require_once( ABSPATH . WPINC . '/template-loader.php' ); + require_once ABSPATH . WPINC . '/template-loader.php'; ob_get_clean(); } @@ -206,7 +210,7 @@ function( $template ) { * @see http://stackoverflow.com/questions/2637945/getting-relative-path-from-absolute-path-in-php */ private static function get_relative_path( $from, $to ) { - // some compatibility fixes for Windows paths + // some compatibility fixes for Windows paths. $from = is_dir( $from ) ? rtrim( $from, '\/' ) . '/' : $from; $to = is_dir( $to ) ? rtrim( $to, '\/' ) . '/' : $to; $from = str_replace( '\\', '/', $from ); @@ -217,15 +221,15 @@ private static function get_relative_path( $from, $to ) { $rel_path = $to; foreach ( $from as $depth => $dir ) { - // find first non-matching dir + // find first non-matching dir. if ( $dir === $to[ $depth ] ) { - // ignore this directory + // ignore this directory. array_shift( $rel_path ); } else { - // get number of remaining dirs to $from + // get number of remaining dirs to $from. $remaining = count( $from ) - $depth; if ( $remaining > 1 ) { - // add traversals up to first matching dir + // add traversals up to first matching dir. $pad_length = ( count( $rel_path ) + $remaining - 1 ) * -1; $rel_path = array_pad( $rel_path, $pad_length, '..' ); break; diff --git a/composer.json b/composer.json index 4652b50..9bc37b1 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,9 @@ "behat/behat": "^3.1", "behat/mink-extension": "^2.2", "behat/mink-goutte-driver": "^1.2", - "pantheon-systems/pantheon-wordpress-upstream-tests": "dev-fix-behat-upstream-tests", - "wp-coding-standards/wpcs": "dev-develop as 2.3.1", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", + "pantheon-systems/pantheon-wp-coding-standards": "^1.0", + "pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master", "phpunit/phpunit": "^9", - "phpcompatibility/php-compatibility": "^9.3", "yoast/phpunit-polyfills": "^1.0" }, "scripts": { diff --git a/composer.lock b/composer.lock index 2a799ca..2bd200e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,61 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9632405459397716afbb9a9350dd6b98", + "content-hash": "ed9a1eaaf549f309898788e661ea2a5c", "packages": [], "packages-dev": [ + { + "name": "automattic/vipwpcs", + "version": "2.3.3", + "source": { + "type": "git", + "url": "https://github.com/Automattic/VIP-Coding-Standards.git", + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", + "reference": "6cd0a6a82bc0ac988dbf9d6a7c2e293dc8ac640b", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7", + "php": ">=5.4", + "sirbrillig/phpcs-variable-analysis": "^2.11.1", + "squizlabs/php_codesniffer": "^3.5.5", + "wp-coding-standards/wpcs": "^2.3" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^0.5", + "php-parallel-lint/php-parallel-lint": "^1.0", + "phpcompatibility/php-compatibility": "^9", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/Automattic/VIP-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress VIP minimum coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/Automattic/VIP-Coding-Standards/issues", + "source": "https://github.com/Automattic/VIP-Coding-Standards", + "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" + }, + "time": "2021-09-29T16:20:23+00:00" + }, { "name": "behat/behat", "version": "v3.13.0", @@ -456,38 +508,35 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "version": "v0.7.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", + "php": ">=5.3", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -503,7 +552,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -527,37 +576,37 @@ "tests" ], "support": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2023-01-05T11:28:13+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "doctrine/instantiator", - "version": "2.0.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -584,7 +633,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, "funding": [ { @@ -600,7 +649,7 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "fabpot/goutte", @@ -662,6 +711,62 @@ "abandoned": "symfony/browser-kit", "time": "2020-11-01T09:30:18+00:00" }, + { + "name": "fig-r/psr2r-sniffer", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig-rectified/psr2r-sniffer.git", + "reference": "53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2", + "reference": "53ca1ecd62b0dc2ab8ea48635f583cb361c5e8f2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "slevomat/coding-standard": "^7.2.0 || ^8.3.0", + "spryker/code-sniffer": "^0.17.1", + "squizlabs/php_codesniffer": "^3.7.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.0.0" + }, + "bin": [ + "bin/tokenize", + "bin/sniff" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PSR2R\\": "PSR2R/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Scherer", + "homepage": "https://www.dereuromark.de", + "role": "Contributor" + } + ], + "description": "Code-Sniffer, Auto-Fixer and Tokenizer for PSR2-R", + "keywords": [ + "codesniffer", + "cs", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-fig-rectified/psr2r-sniffer/issues", + "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/1.5.0" + }, + "time": "2023-01-01T15:31:05+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.5.8", @@ -1083,16 +1188,16 @@ }, { "name": "pantheon-systems/pantheon-wordpress-upstream-tests", - "version": "dev-fix-behat-upstream-tests", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/pantheon-systems/pantheon-wordpress-upstream-tests.git", - "reference": "0398d7183db0ad3ab0bf6c65c39174f297ad2c49" + "reference": "1a0d50c12413b3643a24b578a23b819f11e35ebf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pantheon-systems/pantheon-wordpress-upstream-tests/zipball/0398d7183db0ad3ab0bf6c65c39174f297ad2c49", - "reference": "0398d7183db0ad3ab0bf6c65c39174f297ad2c49", + "url": "https://api.github.com/repos/pantheon-systems/pantheon-wordpress-upstream-tests/zipball/1a0d50c12413b3643a24b578a23b819f11e35ebf", + "reference": "1a0d50c12413b3643a24b578a23b819f11e35ebf", "shasum": "" }, "require": { @@ -1100,6 +1205,7 @@ "behat/mink-extension": "^2.2", "behat/mink-goutte-driver": "^1.2" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { @@ -1115,9 +1221,51 @@ ], "support": { "issues": "https://github.com/pantheon-systems/pantheon-wordpress-upstream-tests/issues", - "source": "https://github.com/pantheon-systems/pantheon-wordpress-upstream-tests/tree/fix-behat-upstream-tests" + "source": "https://github.com/pantheon-systems/pantheon-wordpress-upstream-tests/tree/master" + }, + "time": "2020-04-17T11:46:11+00:00" + }, + { + "name": "pantheon-systems/pantheon-wp-coding-standards", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/pantheon-systems/Pantheon-WP-Coding-Standards.git", + "reference": "1e8fb654d52b9274f548c46f89d98f4913307fdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pantheon-systems/Pantheon-WP-Coding-Standards/zipball/1e8fb654d52b9274f548c46f89d98f4913307fdf", + "reference": "1e8fb654d52b9274f548c46f89d98f4913307fdf", + "shasum": "" + }, + "require": { + "automattic/vipwpcs": "^2.3", + "fig-r/psr2r-sniffer": "^1.5", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "wp-coding-standards/wpcs": "^2.3" + }, + "require-dev": { + "phpunit/phpunit": "9.6.x-dev", + "yoast/phpunit-polyfills": "1.x-dev" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Pantheon", + "email": "noreply@pantheon.io" + } + ], + "description": "PHPCS Rulesets for WordPress projects on Pantheon.", + "support": { + "issues": "https://github.com/pantheon-systems/Pantheon-WP-Coding-Standards/issues", + "source": "https://github.com/pantheon-systems/Pantheon-WP-Coding-Standards/tree/1.0.1" }, - "time": "2023-04-21T22:01:33+00:00" + "time": "2023-04-14T16:54:02+00:00" }, { "name": "phar-io/manifest", @@ -1293,141 +1441,161 @@ "time": "2019-12-27T09:44:58+00:00" }, { - "name": "phpcsstandards/phpcsextra", - "version": "1.0.3", + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.2", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "7029c051cd310e2e17c6caea3429bfbe290c41ae" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/7029c051cd310e2e17c6caea3429bfbe290c41ae", - "reference": "7029c051cd310e2e17c6caea3429bfbe290c41ae", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "shasum": "" }, "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0", - "squizlabs/php_codesniffer": "^3.7.1" + "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.5", - "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", + "name": "Wim Godden", "role": "lead" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", + "compatibility", + "paragonie", "phpcs", + "polyfill", "standards", "static analysis" ], "support": { - "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", - "source": "https://github.com/PHPCSStandards/PHPCSExtra" + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2023-03-28T17:48:27+00:00" + "time": "2022-10-25T01:46:02+00:00" }, { - "name": "phpcsstandards/phpcsutils", - "version": "1.0.5", + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.4", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656" + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/0cfef5193e68e8ff179333d8ae937db62939b656", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "ext-filter": "*", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.3", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3", - "yoast/phpunit-polyfills": "^1.0.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" - } - }, - "autoload": { - "classmap": [ - "PHPCSUtils/" - ] + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", + "name": "Wim Godden", "role": "lead" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + "name": "Juliette Reinders Folmer", + "role": "lead" } ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", + "compatibility", "phpcs", - "phpcs3", "standards", "static analysis", - "tokens", - "utility" + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2022-10-24T09:00:36+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.20.4", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { - "docs": "https://phpcsutils.com/", - "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", - "source": "https://github.com/PHPCSStandards/PHPCSUtils" + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" }, - "time": "2023-04-17T16:27:27+00:00" + "time": "2023-05-02T09:19:37+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3009,6 +3177,187 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "sirbrillig/phpcs-variable-analysis", + "version": "v2.11.16", + "source": { + "type": "git", + "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/dc5582dc5a93a235557af73e523c389aac9a8e88", + "reference": "dc5582dc5a93a235557af73e523c389aac9a8e88", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", + "sirbrillig/phpcs-import-detection": "^1.1", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A PHPCS sniff to detect problems with variables.", + "keywords": [ + "phpcs", + "static analysis" + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" + }, + "time": "2023-03-31T16:46:32+00:00" + }, + { + "name": "slevomat/coding-standard", + "version": "8.11.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "af87461316b257e46e15bb041dca6fca3796d822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/af87461316b257e46e15bb041dca6fca3796d822", + "reference": "af87461316b257e46e15bb041dca6fca3796d822", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": ">=1.20.0 <1.21.0", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.14", + "phpstan/phpstan-deprecation-rules": "1.1.3", + "phpstan/phpstan-phpunit": "1.3.11", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "7.5.20|8.5.21|9.6.6|10.1.1" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.11.1" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2023-04-24T08:19:01+00:00" + }, + { + "name": "spryker/code-sniffer", + "version": "0.17.18", + "source": { + "type": "git", + "url": "https://github.com/spryker/code-sniffer.git", + "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/5fb8b573abc4a906d0d364a4a03abd38e565ba29", + "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29", + "shasum": "" + }, + "require": { + "php": ">=7.4", + "slevomat/coding-standard": "^7.2.0 || ^8.0.1", + "squizlabs/php_codesniffer": "^3.6.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.0.0", + "phpunit/phpunit": "^9.5" + }, + "bin": [ + "bin/tokenize" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "Spryker\\": "Spryker/", + "SprykerStrict\\": "SprykerStrict/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spryker", + "homepage": "https://spryker.com" + } + ], + "description": "Spryker Code Sniffer Standards", + "homepage": "https://spryker.com", + "keywords": [ + "codesniffer", + "framework", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/spryker/code-sniffer/issues", + "source": "https://github.com/spryker/code-sniffer" + }, + "time": "2023-01-03T16:08:22+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.7.2", @@ -3469,25 +3818,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3516,7 +3865,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { @@ -3532,7 +3881,7 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/dom-crawler", @@ -3695,20 +4044,20 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.2.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd" + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", - "reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7bc61cc2db649b4637d331240c5346dcc7708051", + "reference": "7bc61cc2db649b4637d331240c5346dcc7708051", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "psr/event-dispatcher": "^1" }, "suggest": { @@ -3717,7 +4066,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -3754,7 +4103,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.2" }, "funding": [ { @@ -3770,7 +4119,7 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/filesystem", @@ -4655,20 +5004,20 @@ }, { "name": "symfony/string", - "version": "v6.2.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -4680,7 +5029,6 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -4721,7 +5069,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.2.8" + "source": "https://github.com/symfony/string/tree/v6.0.19" }, "funding": [ { @@ -4737,7 +5085,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "symfony/translation", @@ -4908,20 +5256,20 @@ }, { "name": "symfony/yaml", - "version": "v6.2.10", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "61916f3861b1e9705b18cfde723921a71dd1559d" + "reference": "deec3a812a0305a50db8ae689b183f43d915c884" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/61916f3861b1e9705b18cfde723921a71dd1559d", - "reference": "61916f3861b1e9705b18cfde723921a71dd1559d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/deec3a812a0305a50db8ae689b183f43d915c884", + "reference": "deec3a812a0305a50db8ae689b183f43d915c884", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "^1.8" }, "conflict": { @@ -4962,7 +5310,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.10" + "source": "https://github.com/symfony/yaml/tree/v6.0.19" }, "funding": [ { @@ -4978,7 +5326,7 @@ "type": "tidelift" } ], - "time": "2023-04-28T13:25:36+00:00" + "time": "2023-01-11T11:50:03+00:00" }, { "name": "theseer/tokenizer", @@ -5032,36 +5380,31 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "dev-develop", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "fca9d9ef2dcd042658ccb9df16552f5048e7bb04" + "reference": "7da1894633f168fe244afc6de00d141f27517b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/fca9d9ef2dcd042658ccb9df16552f5048e7bb04", - "reference": "fca9d9ef2dcd042658ccb9df16552f5048e7bb04", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", + "reference": "7da1894633f168fe244afc6de00d141f27517b62", "shasum": "" }, "require": { - "ext-filter": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.0", - "phpcsstandards/phpcsutils": "^1.0.5", - "squizlabs/php_codesniffer": "^3.7.2" + "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "ext-mbstring": "For improved results" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, - "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5077,7 +5420,6 @@ "keywords": [ "phpcs", "standards", - "static analysis", "wordpress" ], "support": { @@ -5085,7 +5427,7 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2023-05-01T08:34:06+00:00" + "time": "2020-05-13T23:57:56+00:00" }, { "name": "yoast/phpunit-polyfills", @@ -5148,18 +5490,10 @@ "time": "2023-03-30T23:39:05+00:00" } ], - "aliases": [ - { - "package": "wp-coding-standards/wpcs", - "version": "dev-develop", - "alias": "2.3.1", - "alias_normalized": "2.3.1.0" - } - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": { - "pantheon-systems/pantheon-wordpress-upstream-tests": 20, - "wp-coding-standards/wpcs": 20 + "pantheon-systems/pantheon-wordpress-upstream-tests": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/object-cache.php b/object-cache.php index 290d950..e849c2c 100644 --- a/object-cache.php +++ b/object-cache.php @@ -1,10 +1,12 @@ _exists( $key, $group ) ) { return false; } @@ -629,7 +622,7 @@ public function delete_group( $group ) { * @return bool Always returns true */ public function flush( $redis = true ) { - $this->cache = array(); + $this->cache = []; if ( $redis ) { $this->_call_redis( 'flushdb' ); } @@ -658,15 +651,14 @@ public function get( $key, $group = 'default', $force = false, &$found = null ) $group = 'default'; } - // Key is set internally, so we can use this value + // Key is set internally, so we can use this value. if ( $this->_isset_internal( $key, $group ) && ! $force ) { $this->cache_hits += 1; $found = true; return $this->_get_internal( $key, $group ); } - // Not a persistent group, so don't try Redis if the value doesn't exist - // internally + // Not a persistent group, so don't try Redis if the value doesn't exist internally. if ( ! $this->_should_persist( $group ) ) { $this->cache_misses += 1; $found = false; @@ -681,14 +673,14 @@ public function get( $key, $group = 'default', $force = false, &$found = null ) $value = $this->_call_redis( 'get', $id ); } - // PhpRedis returns `false` when the key doesn't exist + // PhpRedis returns `false` when the key doesn't exist. if ( false === $value ) { $this->cache_misses += 1; $found = false; return false; } - // All non-numeric values are serialized + // All non-numeric values are serialized. $value = is_numeric( $value ) ? intval( $value ) : unserialize( $value ); $this->_set_internal( $key, $group, $value ); @@ -711,7 +703,7 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { $group = 'default'; } - $cache = array(); + $cache = []; if ( ! $this->_should_persist( $group ) ) { foreach ( $keys as $key ) { $cache[ $key ] = $this->_isset_internal( $key, $group ) ? $this->_get_internal( $key, $group ) : false; @@ -739,7 +731,7 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { $results = $this->_call_redis( 'hmGet', $redis_safe_group, $remaining_keys ); $results = is_array( $results ) ? array_values( $results ) : $results; } else { - $ids = array(); + $ids = []; foreach ( $remaining_keys as $key ) { $ids[] = $this->_key( $key, $group ); } @@ -749,7 +741,7 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { foreach ( $remaining_keys as $i => $key ) { $value = isset( $results[ $i ] ) ? $results[ $i ] : false; if ( false !== $value ) { - // All non-numeric values are serialized + // All non-numeric values are serialized. $value = is_numeric( $value ) ? intval( $value ) : unserialize( $value ); $this->_set_internal( $key, $group, $value ); $this->cache_hits++; @@ -759,7 +751,7 @@ public function get_multiple( $keys, $group = 'default', $force = false ) { $cache[ $key ] = $value; } // Make sure return values are returned in the order of the passed keys. - $return_cache = array(); + $return_cache = []; foreach ( $keys as $key ) { $return_cache[ $key ] = isset( $cache[ $key ] ) ? $cache[ $key ] : false; } @@ -780,7 +772,7 @@ public function incr( $key, $offset = 1, $group = 'default' ) { $group = 'default'; } - // The key needs to exist in order to be incremented + // The key needs to exist in order to be incremented. if ( ! $this->_exists( $key, $group ) ) { return false; } @@ -826,6 +818,7 @@ public function incr( $key, $offset = 1, $group = 'default' ) { /** * Replace the contents in the cache, if contents already exist + * * @see WP_Object_Cache::set() * * @param int|string $key What to call the contents in the cache @@ -895,7 +888,7 @@ public function set( $key, $data, $group = 'default', $expire = WP_REDIS_DEFAULT $data = serialize( $data ); } - // Redis doesn't support expire on hash group keys + // Redis doesn't support expire on hash group keys. if ( $this->_should_use_redis_hashes( $group ) ) { $redis_safe_group = $this->_key( '', $group ); $this->_call_redis( 'hSet', $redis_safe_group, $key, $data ); @@ -922,7 +915,7 @@ public function stats() { foreach ( $this->redis_calls as $method => $calls ) { $total_redis_calls += $calls; } - $out = array(); + $out = []; $out[] = '
';
$out[] = 'Cache Hits:' . (int) $this->cache_hits . '
';
$out[] = 'Cache Misses:' . (int) $this->cache_misses . '
';
@@ -937,9 +930,7 @@ public function stats() {
$out[] = '