diff --git a/.travis.yml b/.travis.yml
index 5b3d2f3..20323fb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,3 @@
-sudo: false
language: php
dist: trusty
@@ -12,12 +11,16 @@ cache:
matrix:
fast_finish: true
include:
- - php: 7.2
+ - php: 7.4
env: WP_VERSION=trunk
- - php: 7.2
+ - php: 7.4
env: WP_VERSION=trunk COMPOSER_LOWEST=1
- - php: 7.2
+ - php: 7.3
env: WP_VERSION=latest RUN_PHPCS=1 RUN_CODE_COVERAGE=1
+ - php: 7.3
+ env: WP_VERSION=latest
+ - php: 7.2
+ env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
@@ -31,7 +34,7 @@ before_script:
chmod +x coveralls.phar
mkdir -p build/logs
else
- phpenv config-rm xdebug.ini
+ phpenv config-rm xdebug.ini || echo 'No xdebug config.'
fi
- |
if [[ ! -z "$WP_VERSION" ]]; then
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1be802..42110ac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [1.1.2] - 2022-05-26
+
+* Update PHP compatiblity checks ([#6], props @jrfnl)
+* Update test builds ([#6], props @jrfnl)
+* Allow recent versions of [composer/installers](https://github.com/composer/installers) and [dealerdirect/phpcodesniffer-composer-installer](https://github.com/PHPCSStandards/composer-installer) packages ([#7], props @macbookandrew)
+
## [1.1.1] - 2018-06-14
* Lower the minimum version of [composer/installers](https://github.com/composer/installers) to `^1.0` ([#2], props @aaemnnosttv).
diff --git a/composer.json b/composer.json
index a6defd7..8bf860f 100644
--- a/composer.json
+++ b/composer.json
@@ -23,12 +23,12 @@
"minimum-stability": "stable",
"require": {
"php": ">=5.2",
- "composer/installers": "^1.0"
+ "composer/installers": "^1.0||^2.0"
},
"require-dev": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
- "wimg/php-compatibility": "^8.1",
- "wp-coding-standards/wpcs": "^0.14"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5||^0.6||^0.7",
+ "phpcompatibility/phpcompatibility-wp": "^2.1",
+ "wp-coding-standards/wpcs": "^2.2"
},
"autoload": {
"files": ["wp-cache-remember.php"]
diff --git a/composer.lock b/composer.lock
index 05b0f86..d981efb 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,39 +4,41 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "20b6e39d276e55faa6462ddce04f5cca",
+ "content-hash": "e874ec51f78babdd3904c76ce4f0dae3",
"packages": [
{
"name": "composer/installers",
- "version": "v1.5.0",
+ "version": "v2.1.1",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
- "reference": "049797d727261bf27f2690430d935067710049c2"
+ "reference": "af93ba6e52236418f07a278033eba6959ee5b983"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
- "reference": "049797d727261bf27f2690430d935067710049c2",
+ "url": "https://api.github.com/repos/composer/installers/zipball/af93ba6e52236418f07a278033eba6959ee5b983",
+ "reference": "af93ba6e52236418f07a278033eba6959ee5b983",
"shasum": ""
},
"require": {
- "composer-plugin-api": "^1.0"
- },
- "replace": {
- "roundcube/plugin-installer": "*",
- "shama/baton": "*"
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": "^7.2 || ^8.0"
},
"require-dev": {
- "composer/composer": "1.0.*@dev",
- "phpunit/phpunit": "^4.8.36"
+ "composer/composer": "1.6.* || ^2.0",
+ "composer/semver": "^1 || ^3",
+ "phpstan/phpstan": "^0.12.55",
+ "phpstan/phpstan-phpunit": "^0.12.16",
+ "symfony/phpunit-bridge": "^5.3",
+ "symfony/process": "^5"
},
"type": "composer-plugin",
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
- "dev-master": "1.0-dev"
- }
+ "dev-main": "2.x-dev"
+ },
+ "plugin-modifies-install-path": true
},
"autoload": {
"psr-4": {
@@ -57,7 +59,6 @@
"description": "A multi-framework Composer library installer",
"homepage": "https://composer.github.io/installers/",
"keywords": [
- "Craft",
"Dolibarr",
"Eliasis",
"Hurad",
@@ -65,6 +66,7 @@
"Kanboard",
"Lan Management System",
"MODX Evo",
+ "MantisBT",
"Mautic",
"Maya",
"OXID",
@@ -72,10 +74,11 @@
"Porto",
"RadPHP",
"SMF",
+ "Starbug",
"Thelia",
+ "Whmcs",
"WolfCMS",
"agl",
- "aimeos",
"annotatecms",
"attogram",
"bitrix",
@@ -94,7 +97,7 @@
"grav",
"installer",
"itop",
- "joomla",
+ "known",
"kohana",
"laravel",
"lavalite",
@@ -103,13 +106,16 @@
"majima",
"mako",
"mediawiki",
+ "miaoxing",
"modulework",
"modx",
"moodle",
"osclass",
+ "pantheon",
"phpbb",
"piwik",
"ppi",
+ "processwire",
"puppet",
"pxcms",
"reindex",
@@ -117,42 +123,58 @@
"shopware",
"silverstripe",
"sydes",
- "symfony",
- "typo3",
+ "sylius",
+ "tastyigniter",
"wordpress",
"yawik",
"zend",
"zikula"
],
- "time": "2017-12-29T09:13:20+00:00"
+ "support": {
+ "issues": "https://github.com/composer/installers/issues",
+ "source": "https://github.com/composer/installers/tree/v2.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-04-13T09:13:00+00:00"
}
],
"packages-dev": [
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
- "version": "v0.4.4",
+ "version": "v0.7.2",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
- "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08"
+ "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08",
- "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08",
+ "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
+ "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
"shasum": ""
},
"require": {
- "composer-plugin-api": "^1.0",
- "php": "^5.3|^7",
- "squizlabs/php_codesniffer": "*"
+ "composer-plugin-api": "^1.0 || ^2.0",
+ "php": ">=5.3",
+ "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
- "wimg/php-compatibility": "^8.0"
- },
- "suggest": {
- "dealerdirect/qa-tools": "All the PHP QA tools you'll need"
+ "php-parallel-lint/php-parallel-lint": "^1.3.1",
+ "phpcompatibility/php-compatibility": "^9.0"
},
"type": "composer-plugin",
"extra": {
@@ -170,13 +192,17 @@
"authors": [
{
"name": "Franck Nijhof",
- "email": "f.nijhof@dealerdirect.nl",
- "homepage": "http://workingatdealerdirect.eu",
- "role": "Developer"
+ "email": "franck.nijhof@dealerdirect.com",
+ "homepage": "http://www.frenck.nl",
+ "role": "Developer / IT Manager"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
- "homepage": "http://workingatdealerdirect.eu",
+ "homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
@@ -184,6 +210,7 @@
"codesniffer",
"composer",
"installer",
+ "phpcbf",
"phpcs",
"plugin",
"qa",
@@ -194,131 +221,266 @@
"stylecheck",
"tests"
],
- "time": "2017-12-06T16:27:17+00:00"
+ "support": {
+ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
+ "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
+ },
+ "time": "2022-02-04T12:51:07+00:00"
},
{
- "name": "squizlabs/php_codesniffer",
- "version": "3.3.0",
+ "name": "phpcompatibility/php-compatibility",
+ "version": "9.3.5",
"source": {
"type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266"
+ "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
- "reference": "d86873af43b4aa9d1f39a3601cc0cfcf02b25266",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
+ "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
"shasum": ""
},
"require": {
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": ">=5.4.0"
+ "php": ">=5.3",
+ "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
+ },
+ "conflict": {
+ "squizlabs/php_codesniffer": "2.6.2"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
},
- "bin": [
- "bin/phpcs",
- "bin/phpcbf"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
+ "suggest": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS '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": [
- "BSD-3-Clause"
+ "LGPL-3.0-or-later"
],
"authors": [
{
- "name": "Greg Sherwood",
+ "name": "Wim Godden",
+ "homepage": "https://github.com/wimg",
"role": "lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "homepage": "https://github.com/jrfnl",
+ "role": "lead"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
}
],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
+ "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
"keywords": [
+ "compatibility",
"phpcs",
"standards"
],
- "time": "2018-06-06T23:58:19+00:00"
+ "support": {
+ "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
+ "source": "https://github.com/PHPCompatibility/PHPCompatibility"
+ },
+ "time": "2019-12-27T09:44:58+00:00"
},
{
- "name": "wimg/php-compatibility",
- "version": "8.1.0",
+ "name": "phpcompatibility/phpcompatibility-paragonie",
+ "version": "1.3.1",
"source": {
"type": "git",
- "url": "https://github.com/wimg/PHPCompatibility.git",
- "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e"
+ "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
+ "reference": "ddabec839cc003651f2ce695c938686d1086cf43"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e",
- "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43",
+ "reference": "ddabec839cc003651f2ce695c938686d1086cf43",
"shasum": ""
},
"require": {
- "php": ">=5.3",
- "squizlabs/php_codesniffer": "^2.2 || ^3.0.2"
- },
- "conflict": {
- "squizlabs/php_codesniffer": "2.6.2"
+ "phpcompatibility/php-compatibility": "^9.0"
},
"require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7",
+ "paragonie/random_compat": "dev-master",
+ "paragonie/sodium_compat": "dev-master"
},
"suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
+ "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",
- "autoload": {
- "psr-4": {
- "PHPCompatibility\\": "PHPCompatibility/"
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Wim Godden",
+ "role": "lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "lead"
}
+ ],
+ "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": [
+ "compatibility",
+ "paragonie",
+ "phpcs",
+ "polyfill",
+ "standards"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
+ "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
+ },
+ "time": "2021-02-15T10:24:51+00:00"
+ },
+ {
+ "name": "phpcompatibility/phpcompatibility-wp",
+ "version": "2.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
+ "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308",
+ "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308",
+ "shasum": ""
+ },
+ "require": {
+ "phpcompatibility/php-compatibility": "^9.0",
+ "phpcompatibility/phpcompatibility-paragonie": "^1.0"
},
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.7"
+ },
+ "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"
+ "LGPL-3.0-or-later"
],
"authors": [
{
"name": "Wim Godden",
"role": "lead"
+ },
+ {
+ "name": "Juliette Reinders Folmer",
+ "role": "lead"
}
],
- "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.",
- "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
+ "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": [
"compatibility",
+ "phpcs",
+ "standards",
+ "wordpress"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
+ "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
+ },
+ "time": "2021-12-30T16:37:40+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "keywords": [
"phpcs",
"standards"
],
- "time": "2017-12-27T21:58:38+00:00"
+ "support": {
+ "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
+ "source": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ },
+ "time": "2021-12-12T21:44:58+00:00"
},
{
"name": "wp-coding-standards/wpcs",
- "version": "0.14.1",
+ "version": "2.3.0",
"source": {
"type": "git",
- "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git",
- "reference": "cf6b310caad735816caef7573295f8a534374706"
+ "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
+ "reference": "7da1894633f168fe244afc6de00d141f27517b62"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/cf6b310caad735816caef7573295f8a534374706",
- "reference": "cf6b310caad735816caef7573295f8a534374706",
+ "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
+ "reference": "7da1894633f168fe244afc6de00d141f27517b62",
"shasum": ""
},
"require": {
- "php": ">=5.3",
- "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2"
+ "php": ">=5.4",
+ "squizlabs/php_codesniffer": "^3.3.1"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
+ "phpcompatibility/php-compatibility": "^9.0",
+ "phpcsstandards/phpcsdevtools": "^1.0",
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
- "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
@@ -328,7 +490,7 @@
"authors": [
{
"name": "Contributors",
- "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors"
+ "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
@@ -337,7 +499,12 @@
"standards",
"wordpress"
],
- "time": "2018-02-16T01:57:48+00:00"
+ "support": {
+ "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
+ "source": "https://github.com/WordPress/WordPress-Coding-Standards",
+ "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
+ },
+ "time": "2020-05-13T23:57:56+00:00"
}
],
"aliases": [],
@@ -348,5 +515,6 @@
"platform": {
"php": ">=5.2"
},
- "platform-dev": []
+ "platform-dev": [],
+ "plugin-api-version": "2.3.0"
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index daf4e84..3bdad2a 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -13,7 +13,8 @@
-
+
+
tests/*
diff --git a/tests/test-object-cache.php b/tests/test-object-cache.php
index 3b32473..48c6e89 100644
--- a/tests/test-object-cache.php
+++ b/tests/test-object-cache.php
@@ -30,9 +30,12 @@ function test_does_not_cache_exceptions() {
$key = 'some-cache-key-' . uniqid();
try {
- wp_cache_remember( $key, function () {
- throw new Exception( 'Something went wrong!' );
- } );
+ wp_cache_remember(
+ $key,
+ function () {
+ throw new Exception( 'Something went wrong!' );
+ }
+ );
} catch ( Exception $e ) {
$this->assertFalse( wp_cache_get( $key ), 'Expected the exception to not be cached.' );
@@ -45,9 +48,12 @@ function test_does_not_cache_exceptions() {
function test_does_not_cache_wp_errors() {
$key = 'some-cache-key-' . uniqid();
- wp_cache_remember( $key, function () {
- return new WP_Error( 'code', 'Something went wrong!' );
- } );
+ wp_cache_remember(
+ $key,
+ function () {
+ return new WP_Error( 'code', 'Something went wrong!' );
+ }
+ );
$this->assertFalse( wp_cache_get( $key ), 'Expected the WP_Error to not be cached.' );
}
diff --git a/tests/test-site-transients.php b/tests/test-site-transients.php
index 842f6b7..33b8f5e 100644
--- a/tests/test-site-transients.php
+++ b/tests/test-site-transients.php
@@ -30,9 +30,12 @@ function test_does_not_remember_exceptions() {
$key = 'some-cache-key-' . uniqid();
try {
- remember_site_transient( $key, function () {
- throw new Exception( 'Something went wrong!' );
- } );
+ remember_site_transient(
+ $key,
+ function () {
+ throw new Exception( 'Something went wrong!' );
+ }
+ );
} catch ( Exception $e ) {
$this->assertFalse( get_site_transient( $key ), 'Expected the exception to not be cached.' );
@@ -45,9 +48,12 @@ function test_does_not_remember_exceptions() {
function test_does_not_remember_wp_errors() {
$key = 'some-cache-key-' . uniqid();
- remember_site_transient( $key, function () {
- return new WP_Error( 'code', 'Something went wrong!' );
- } );
+ remember_site_transient(
+ $key,
+ function () {
+ return new WP_Error( 'code', 'Something went wrong!' );
+ }
+ );
$this->assertFalse( get_site_transient( $key ), 'Expected the WP_Error to not be cached.' );
}
diff --git a/tests/test-transients.php b/tests/test-transients.php
index 871da87..f5d0cad 100644
--- a/tests/test-transients.php
+++ b/tests/test-transients.php
@@ -30,9 +30,12 @@ function test_does_not_remember_exceptions() {
$key = 'some-cache-key-' . uniqid();
try {
- remember_transient( $key, function () {
- throw new Exception( 'Something went wrong!' );
- } );
+ remember_transient(
+ $key,
+ function () {
+ throw new Exception( 'Something went wrong!' );
+ }
+ );
} catch ( Exception $e ) {
$this->assertFalse( get_transient( $key ), 'Expected the exception to not be cached.' );
@@ -45,9 +48,12 @@ function test_does_not_remember_exceptions() {
function test_does_not_remember_wp_errors() {
$key = 'some-cache-key-' . uniqid();
- remember_transient( $key, function () {
- return new WP_Error( 'code', 'Something went wrong!' );
- } );
+ remember_transient(
+ $key,
+ function () {
+ return new WP_Error( 'code', 'Something went wrong!' );
+ }
+ );
$this->assertFalse( get_transient( $key ), 'Expected the WP_Error to not be cached.' );
}
diff --git a/wp-cache-remember.php b/wp-cache-remember.php
index cd011ab..d619273 100644
--- a/wp-cache-remember.php
+++ b/wp-cache-remember.php
@@ -5,7 +5,7 @@
* Description: Helper for the WordPress object cache and transients.
* Author: Steve Grunwell
* Author URI: https://stevegrunwell.com
- * Version: 1.1.1
+ * Version: 1.1.2
*
* @package SteveGrunwell\WPCacheRemember
*/