From bdd8b78d147ca10fc9fea3ae92e4b11efa62d839 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Wed, 18 Nov 2026 12:12:22 +0100 Subject: [PATCH 1/7] Add a PHPUnit integration suite and a test workflow Sets up PHPUnit the way fewer-tags and comment-experience do: yoast/wp-test-utils, tests/bin/install-wp-tests.sh and `composer test`. The lock file is resolved for PHP 7.4 (config.platform.php), the lowest version the plugin supports. The first suite (52 tests) covers the tracking table, option access tracking, activation/deactivation, the known-plugins mapping, and the REST routes that change or delete options, including the capability and nonce checks. test.yml runs it on PHP 7.4/WP 6.7, PHP 8.2/WP latest and PHP 8.4/WP latest multisite. PHPStan now also skips node_modules, which holds PHP files after `npm ci`. Co-Authored-By: Claude Fable 5.2 --- .github/workflows/test.yml | 97 + composer.json | 9 +- composer.lock | 2869 +++++++++++++++-- phpstan.neon.dist | 1 + phpunit.xml.dist | 31 + tests/bin/install-wp-tests.sh | 225 ++ tests/bootstrap.php | 34 + tests/phpunit/class-activation-test.php | 80 + tests/phpunit/class-database-test.php | 263 ++ .../class-map-plugin-to-options-test.php | 67 + tests/phpunit/class-plugin-test.php | 227 ++ tests/phpunit/class-rest-test.php | 464 +++ tests/phpunit/class-test-case.php | 120 + 13 files changed, 4139 insertions(+), 348 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 phpunit.xml.dist create mode 100755 tests/bin/install-wp-tests.sh create mode 100644 tests/bootstrap.php create mode 100644 tests/phpunit/class-activation-test.php create mode 100644 tests/phpunit/class-database-test.php create mode 100644 tests/phpunit/class-map-plugin-to-options-test.php create mode 100644 tests/phpunit/class-plugin-test.php create mode 100644 tests/phpunit/class-rest-test.php create mode 100644 tests/phpunit/class-test-case.php diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b9c7dcc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,97 @@ +name: Test + +on: + # Run on pushes to select branches and on all pull requests. + push: + branches: + - main + - develop + - 'release/[0-9]+.[0-9]+*' + - 'hotfix/[0-9]+.[0-9]+*' + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + # Lowest supported PHP and WordPress versions (see the plugin header). + - php_version: '7.4' + wp_version: '6.7' + multisite: false + + - php_version: '8.2' + wp_version: 'latest' + multisite: false + + - php_version: '8.4' + wp_version: 'latest' + multisite: true + + name: "Integration Test: PHP ${{ matrix.php_version }} | WP ${{ matrix.wp_version }}${{ matrix.multisite == true && ' (+ ms)' || '' }}" + + services: + mysql: + image: mysql:8.0 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: false + ports: + - 3306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10 + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Install PHP + uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # 2.40.0 + with: + php-version: ${{ matrix.php_version }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On + coverage: none + + # The lock file is resolved for PHP 7.4. Let Composer pick the PHPUnit + # version that fits the PHP version of this job instead. + - name: "Composer: remove the PHP platform requirement" + run: composer config --unset platform.php + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: "Install Composer dependencies" + uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0 + with: + # Force a `composer update` run. + dependency-versions: "highest" + # But make it selective. + composer-options: "yoast/wp-test-utils --with-dependencies" + # Bust the cache at least once a month - output format: YYYY-MM-DD. + custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + + - name: Install WP + shell: bash + run: tests/bin/install-wp-tests.sh wordpress_tests root '' 127.0.0.1:3306 ${{ matrix.wp_version }} + + - name: Run tests - single site + run: composer test + + - name: Run tests - multisite + if: ${{ matrix.multisite == true }} + run: composer test + env: + WP_MULTISITE: 1 diff --git a/composer.json b/composer.json index c1643cc..be386a0 100644 --- a/composer.json +++ b/composer.json @@ -16,12 +16,16 @@ "phpstan/phpstan": "^2.0", "szepeviktor/phpstan-wordpress": "^2.0", "phpstan/extension-installer": "^1.3", - "phpcompatibility/php-compatibility": "^9.3" + "phpcompatibility/php-compatibility": "^9.3", + "yoast/wp-test-utils": "^1.2" }, "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, "phpstan/extension-installer": true + }, + "platform": { + "php": "7.4.33" } }, "scripts": { @@ -40,6 +44,9 @@ "lint-known-plugins": [ "@php -r \"exit( intval( is_null( json_decode( file_get_contents( './known-plugins/known-plugins.json' ) ) ) ) );\"" ], + "test": [ + "@php ./vendor/phpunit/phpunit/phpunit" + ], "phpstan": [ "@php ./vendor/bin/phpstan analyse --memory-limit=2048M" ] diff --git a/composer.lock b/composer.lock index 4eeceb4..433a72e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,9 +4,129 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "49309948e892429c2a9f26b0e665194e", + "content-hash": "b18aa3dcbdd46a03bb0e486caf135f81", "packages": [], "packages-dev": [ + { + "name": "antecedent/patchwork", + "version": "2.2.5", + "source": { + "type": "git", + "url": "https://github.com/antecedent/patchwork.git", + "reference": "1ea49951bdf0d2d7c0bd436ffd95215e08ed30ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/1ea49951bdf0d2d7c0bd436ffd95215e08ed30ed", + "reference": "1ea49951bdf0d2d7c0bd436ffd95215e08ed30ed", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpcompatibility/php-compatibility": "^10.0.0@alpha", + "phpunit/phpunit": ">=4", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignas Rudaitis", + "email": "ignas.rudaitis@gmail.com" + } + ], + "description": "Method redefinition (monkey-patching) functionality for PHP.", + "homepage": "https://antecedent.github.io/patchwork/", + "keywords": [ + "aop", + "aspect", + "interception", + "monkeypatching", + "redefinition", + "runkit", + "testing" + ], + "support": { + "issues": "https://github.com/antecedent/patchwork/issues", + "source": "https://github.com/antecedent/patchwork/tree/2.2.5" + }, + "time": "2026-11-10T09:08:20+00:00" + }, + { + "name": "brain/monkey", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/Brain-WP/BrainMonkey.git", + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", + "reference": "ea3aeb3d559ba3c0930b3f4d210b665a4c044d83", + "shasum": "" + }, + "require": { + "antecedent/patchwork": "^2.1.17", + "mockery/mockery": "~1.3.6 || ~1.4.4 || ~1.5.1 || ^1.6.10", + "php": ">=5.6.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", + "phpcompatibility/php-compatibility": "^9.3.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.49 || ^9.6.30" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev", + "dev-version/1": "1.x-dev" + } + }, + "autoload": { + "files": [ + "inc/api.php" + ], + "psr-4": { + "Brain\\Monkey\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giuseppe Mazzapica", + "email": "giuseppe.mazzapica@gmail.com", + "homepage": "https://gmazzap.me", + "role": "Developer" + } + ], + "description": "Mocking utility for PHP functions and WordPress plugin API", + "keywords": [ + "Monkey Patching", + "interception", + "mock", + "mock functions", + "mockery", + "patchwork", + "redefinition", + "runkit", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/Brain-WP/BrainMonkey/issues", + "source": "https://github.com/Brain-WP/BrainMonkey" + }, + "time": "2026-02-05T09:22:14+00:00" + }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v1.2.1", @@ -104,617 +224,2484 @@ "time": "2026-05-06T08:26:05+00:00" }, { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.4.0", + "name": "doctrine/instantiator", + "version": "1.5.0", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", - "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "ext-json": "*", - "php": ">=5.3.0" - }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" + "php": "^7.1 || ^8.0" }, "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", - "squizlabs/php_codesniffer": "^3.6" + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "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" }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" - }, - "bin": [ - "parallel-lint" - ], "type": "library", "autoload": { - "classmap": [ - "./src/" - ] + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" } ], - "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ - "lint", - "static analysis" + "constructor", + "instantiate" ], "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" }, - "time": "2024-03-27T12:14:49+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" }, { - "name": "php-stubs/wordpress-stubs", - "version": "v7.1.2", + "name": "hamcrest/hamcrest-php", + "version": "v3.0.0", "source": { "type": "git", - "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "6926c5156431a3ff909d43faa16a92a0bc0c2428" + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6926c5156431a3ff909d43faa16a92a0bc0c2428", - "reference": "6926c5156431a3ff909d43faa16a92a0bc0c2428", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b61cd040da1a4925bc90a51c074f5297e7c0fa52", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52", "shasum": "" }, - "conflict": { - "phpdocumentor/reflection-docblock": "5.6.1" + "require": { + "ext-ctype": "*", + "ext-dom": "*", + "php": "^7.4|^8.0" }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "nikic/php-parser": "^5.5", - "php": "^7.4 || ^8.0", - "php-stubs/generator": "^0.9", - "phpdocumentor/reflection-docblock": "^6.0", - "phpstan/phpstan": "^2.2", - "phpunit/phpunit": "^9.5", - "symfony/polyfill-php80": "*", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.2", - "wp-coding-standards/wpcs": "3.4.1 as 2.3.0" + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" }, - "suggest": { - "paragonie/sodium_compat": "Pure PHP implementation of libsodium", - "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + "require-dev": { + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "WordPress function and class declaration stubs for static analysis.", - "homepage": "https://github.com/php-stubs/wordpress-stubs", + "description": "This is the PHP port of Hamcrest Matchers", "keywords": [ - "PHPStan", - "static analysis", - "wordpress" + "test" ], "support": { - "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v7.1.2" + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v3.0.0" }, - "time": "2026-10-06T06:59:21+00:00" + "time": "2026-03-17T11:56:53+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "mockery/mockery", + "version": "1.6.15", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/mockery/mockery.git", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/mockery/mockery/zipball/967a801bd188989a5669bd280f252d51c0fdc9ee", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "hamcrest/hamcrest-php": "^2.0 || ^3.0", + "php": ">=7.3" }, "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "phpunit/phpunit": "<8.0" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^9.6.36", + "symplify/easy-coding-standard": "^13.2.17" }, - "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": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" }, { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ - "compatibility", - "phpcs", - "standards" + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2026-08-19T19:37:52+00:00" }, { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.4", + "name": "myclabs/deep-copy", + "version": "1.13.4", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", - "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0" + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } + "MIT" ], - "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/", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards", - "static analysis" + "clone", + "copy", + "duplicate", + "object", + "object graph" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", - "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - }, - { - "url": "https://thanks.dev/u/gh/phpcompatibility", - "type": "thanks_dev" + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" } ], - "time": "2025-09-19T17:43:28+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.8", + "name": "nikic/php-parser", + "version": "v5.9.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa", - "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0" + }, + "time": "2026-09-13T18:51:52+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "keywords": [ + "lint", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" + }, + "time": "2024-03-27T12:14:49+00:00" + }, + { + "name": "php-stubs/wordpress-stubs", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-stubs/wordpress-stubs.git", + "reference": "6926c5156431a3ff909d43faa16a92a0bc0c2428" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6926c5156431a3ff909d43faa16a92a0bc0c2428", + "reference": "6926c5156431a3ff909d43faa16a92a0bc0c2428", + "shasum": "" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "5.6.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^5.5", + "php": "^7.4 || ^8.0", + "php-stubs/generator": "^0.9", + "phpdocumentor/reflection-docblock": "^6.0", + "phpstan/phpstan": "^2.2", + "phpunit/phpunit": "^9.5", + "symfony/polyfill-php80": "*", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.2", + "wp-coding-standards/wpcs": "3.4.1 as 2.3.0" + }, + "suggest": { + "paragonie/sodium_compat": "Pure PHP implementation of libsodium", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WordPress function and class declaration stubs for static analysis.", + "homepage": "https://github.com/php-stubs/wordpress-stubs", + "keywords": [ + "PHPStan", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v7.1.2" + }, + "time": "2026-10-06T06:59:21+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "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": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "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": "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" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "reference": "244d7b04fc4bc2117c15f5abe23eb933b5f02bbf", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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": "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", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-09-19T17:43:28+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.8", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "reference": "7c8d18b4d90dac9e86b0869a608fa09158e168fa", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0", "squizlabs/php_codesniffer": "^3.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "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", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-10-18T00:05:59+00:00" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "39467533fdb742446d68c1d10ac33d625ee0311c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/39467533fdb742446d68c1d10ac33d625ee0311c", + "reference": "39467533fdb742446d68c1d10ac33d625ee0311c", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.2.3", + "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + } + ], + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-07-27T11:13:17+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/5f35d9408c54d7b529501f3c688b6eae562aea1f", + "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f", + "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.13.5 || ^4.0.1" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + } + ], + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", + "keywords": [ + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", + "phpcs", + "phpcs3", + "phpcs4", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2026-07-27T10:28:41+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0 || ^2.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" + }, + "time": "2024-09-04T20:21:43+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.3.0", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "reference": "b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-10-06T06:15:36+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.32", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.39", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "133394556c813b61aa3481a87bef8419d8ec95c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/133394556c813b61aa3481a87bef8419d8ec95c0", + "reference": "133394556c813b61aa3481a87bef8419d8ec95c0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-filter": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.10", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.9", + "sebastian/global-state": "^5.0.8", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.39" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-11-13T11:05:34+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-01-24T09:22:56+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/4352c1a3df741a7ba9e61af6fed51d1fee41cbf7", + "reference": "4352c1a3df741a7ba9e61af6fed51d1fee41cbf7", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || 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": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.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/", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" + "export", + "exporter" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.9" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", + "url": "https://github.com/sebastianbergmann", "type": "github" }, { - "url": "https://github.com/jrfnl", + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2026-08-11T04:55:59+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://thanks.dev/u/gh/phpcompatibility", + "url": "https://thanks.dev/u/gh/sebastianbergmann", "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2025-10-18T00:05:59+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { - "name": "phpcsstandards/phpcsextra", - "version": "1.5.1", + "name": "sebastian/lines-of-code", + "version": "1.0.4", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "39467533fdb742446d68c1d10ac33d625ee0311c" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/39467533fdb742446d68c1d10ac33d625ee0311c", - "reference": "39467533fdb742446d68c1d10ac33d625ee0311c", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", "shasum": "" }, "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.2.3", - "squizlabs/php_codesniffer": "^3.13.5 || ^4.0.1" + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcsstandards/phpcsdevcs": "^1.2.0", - "phpcsstandards/phpcsdevtools": "^1.2.1", - "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + "phpunit/phpunit": "^9.3" }, - "type": "phpcodesniffer-standard", + "type": "library", "extra": { "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" + "dev-master": "1.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", "role": "lead" - }, + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "standards", - "static analysis" + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { - "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", - "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", - "source": "https://github.com/PHPCSStandards/PHPCSExtra" + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "c85be6922b7fd365942b986b9a50397d65407611" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/c85be6922b7fd365942b986b9a50397d65407611", + "reference": "c85be6922b7fd365942b986b9a50397d65407611", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "url": "https://github.com/jrfnl", + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", "type": "github" }, { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "url": "https://thanks.dev/u/gh/phpcsstandards", + "url": "https://thanks.dev/u/gh/sebastianbergmann", "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2026-07-27T11:13:17+00:00" + "time": "2026-08-11T05:25:24+00:00" }, { - "name": "phpcsstandards/phpcsutils", - "version": "1.2.3", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/5f35d9408c54d7b529501f3c688b6eae562aea1f", - "reference": "5f35d9408c54d7b529501f3c688b6eae562aea1f", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "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.13.5 || ^4.0.1" - }, + "require": { + "php": ">=7.3" + }, "require-dev": { - "ext-filter": "*", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.4.0", - "phpcsstandards/phpcsdevcs": "^1.2.0", - "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" + "phpunit/phpunit": "^9.0" }, - "type": "phpcodesniffer-standard", + "type": "library", "extra": { "branch-alias": { - "dev-stable": "1.x-dev", - "dev-develop": "1.x-dev" + "dev-main": "3.0-dev" } }, "autoload": { "classmap": [ - "PHPCSUtils/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A suite of utility functions for use with PHP_CodeSniffer", - "homepage": "https://phpcsutils.com/", - "keywords": [ - "PHP_CodeSniffer", - "phpcbf", - "phpcodesniffer-standard", - "phpcs", - "phpcs3", - "phpcs4", - "standards", - "static analysis", - "tokens", - "utility" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "docs": "https://phpcsutils.com/", - "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", - "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", - "source": "https://github.com/PHPCSStandards/PHPCSUtils" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { - "url": "https://github.com/PHPCSStandards", - "type": "github" - }, - { - "url": "https://github.com/jrfnl", + "url": "https://github.com/sebastianbergmann", "type": "github" - }, - { - "url": "https://opencollective.com/php_codesniffer", - "type": "open_collective" - }, - { - "url": "https://thanks.dev/u/gh/phpcsstandards", - "type": "thanks_dev" } ], - "time": "2026-07-27T10:28:41+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "phpstan/extension-installer", - "version": "1.4.3", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/phpstan/extension-installer.git", - "reference": "85e90b3942d06b2326fba0403ec24fe912372936" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", - "reference": "85e90b3942d06b2326fba0403ec24fe912372936", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "composer-plugin-api": "^2.0", - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.9.0 || ^2.0" + "php": ">=7.3" }, "require-dev": { - "composer/composer": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + "phpunit/phpunit": "^9.5" }, - "type": "composer-plugin", + "type": "library", "extra": { - "class": "PHPStan\\ExtensionInstaller\\Plugin" + "branch-alias": { + "dev-master": "3.2-dev" + } }, "autoload": { - "psr-4": { - "PHPStan\\ExtensionInstaller\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "Composer plugin for automatic installation of PHPStan extensions", - "keywords": [ - "dev", - "static analysis" + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "issues": "https://github.com/phpstan/extension-installer/issues", - "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, - "time": "2024-09-04T20:21:43+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" }, { - "name": "phpstan/phpstan", - "version": "2.3.0", + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b1f9890d9af53a25c58129e78f0aadd31f90d7f4", - "reference": "b1f9890d9af53a25c58129e78f0aadd31f90d7f4", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": "^7.4|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" + "php": ">=7.3" }, - "bin": [ - "phpstan", - "phpstan.phar" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, "autoload": { - "files": [ - "bootstrap.php" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Ondřej Mirtes" - }, - { - "name": "Markus Staab" - }, - { - "name": "Vincent Langlet" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "PHPStan - PHP Static Analysis Tool", - "keywords": [ - "dev", - "static analysis" - ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", + "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2026-10-06T06:15:36+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -858,6 +2845,56 @@ }, "time": "2026-05-22T16:22:09+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + }, { "name": "wp-coding-standards/wpcs", "version": "3.4.1", @@ -923,6 +2960,141 @@ } ], "time": "2026-07-27T11:53:23+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "41aaac462fbd80feb8dd129e489f4bbc53fe26b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/41aaac462fbd80feb8dd129e489f4bbc53fe26b0", + "reference": "41aaac462fbd80feb8dd129e489f4bbc53fe26b0", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2025-08-10T04:54:36+00:00" + }, + { + "name": "yoast/wp-test-utils", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/Yoast/wp-test-utils.git", + "reference": "e1c316f10ff892fff36116349b59ee5a00174ca3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/wp-test-utils/zipball/e1c316f10ff892fff36116349b59ee5a00174ca3", + "reference": "e1c316f10ff892fff36116349b59ee5a00174ca3", + "shasum": "" + }, + "require": { + "brain/monkey": "^2.7.0", + "php": ">=5.6", + "yoast/phpunit-polyfills": "^1.1.5" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "exclude-from-classmap": [ + "/src/WPIntegration/TestCase.php", + "/src/WPIntegration/TestCaseNoPolyfills.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/wp-test-utils/graphs/contributors" + } + ], + "description": "PHPUnit cross-version compatibility layer for testing plugins and themes build for WordPress", + "homepage": "https://github.com/Yoast/wp-test-utils/", + "keywords": [ + "brainmonkey", + "integration-testing", + "phpunit", + "testing", + "unit-testing", + "wordpress" + ], + "support": { + "issues": "https://github.com/Yoast/wp-test-utils/issues", + "security": "https://github.com/Yoast/wp-test-utils/security/policy", + "source": "https://github.com/Yoast/wp-test-utils" + }, + "time": "2026-02-05T18:06:16+00:00" } ], "aliases": [], @@ -932,5 +3104,8 @@ "prefer-lowest": false, "platform": {}, "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-overrides": { + "php": "7.4.33" + }, + "plugin-api-version": "2.6.0" } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 02967f1..59e180a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -4,4 +4,5 @@ parameters: - . excludePaths: - vendor + - node_modules (?) - tests (?) diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..52066e0 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,31 @@ + + + + + ./aaa-option-optimizer.php + ./src + + + + + ./tests/phpunit/ + + + diff --git a/tests/bin/install-wp-tests.sh b/tests/bin/install-wp-tests.sh new file mode 100755 index 0000000..79b57d8 --- /dev/null +++ b/tests/bin/install-wp-tests.sh @@ -0,0 +1,225 @@ +#!/usr/bin/env bash + +if [ $# -lt 3 ]; then + echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" + exit 1 +fi + +# Function to check if a command exists +command_exists() { + command -v "$1" >/dev/null 2>&1 +} +# Check if SVN is installed +if command_exists svn; then + echo "SVN is already installed." +else + echo "SVN is not installed. Installing SVN..." + # Update the package list + sudo apt-get update -y + # Install SVN + sudo apt-get install -y subversion + # Verify installation + if command_exists svn; then + echo "SVN was successfully installed." + else + echo "Failed to install SVN. Please check your system configuration." + exit 1 + fi +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +DB_HOST=${4-localhost} +WP_VERSION=${5-latest} +SKIP_DB_CREATE=${6-false} + +TMPDIR=${TMPDIR-/tmp} +TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") +WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} +WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} + +download() { + if [ `which curl` ]; then + curl -sL "$1" > "$2"; + elif [ `which wget` ]; then + wget -nv -O "$2" "$1" + fi +} + +if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then + WP_BRANCH=${WP_VERSION%\-*} + WP_TESTS_TAG="branches/$WP_BRANCH" + +elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then + WP_TESTS_TAG="branches/$WP_VERSION" +elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + WP_TESTS_TAG="tags/${WP_VERSION%??}" + else + WP_TESTS_TAG="tags/$WP_VERSION" + fi +elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + WP_TESTS_TAG="trunk" +else + # http serves a single offer, whereas https serves multiple. we only want one + download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json + grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json + LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') + if [[ -z "$LATEST_VERSION" ]]; then + echo "Latest WordPress version could not be found" + exit 1 + fi + WP_TESTS_TAG="tags/$LATEST_VERSION" +fi +set -ex + +install_wp() { + + if [ -d $WP_CORE_DIR ]; then + return; + fi + + mkdir -p $WP_CORE_DIR + + if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + mkdir -p $TMPDIR/wordpress-trunk + rm -rf $TMPDIR/wordpress-trunk/* + svn export https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress + mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR + else + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then + # https serves multiple offers, whereas http serves single. + download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + LATEST_VERSION=${WP_VERSION%??} + else + # otherwise, scan the releases and get the most up to date minor version of the major release + local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` + LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) + fi + if [[ -z "$LATEST_VERSION" ]]; then + local ARCHIVE_NAME="wordpress-$WP_VERSION" + else + local ARCHIVE_NAME="wordpress-$LATEST_VERSION" + fi + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz + tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR + fi + + download https://raw.githubusercontent.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php +} + +install_test_suite() { + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i.bak' + else + local ioption='-i' + fi + + # set up testing suite if it doesn't yet exist + if [ ! -d $WP_TESTS_DIR ]; then + # set up testing suite + mkdir -p $WP_TESTS_DIR + rm -rf $WP_TESTS_DIR/{includes,data} + + # Use GitHub zip downloads instead of svn export. + local GITHUB_TAG=${WP_TESTS_TAG#tags/} + local GITHUB_TAG=${GITHUB_TAG#branches/} + local WP_TESTS_ZIP_URL="" + # Try as a tag first (most common for versioned releases), then as a branch. + for ref_type in tags heads; do + local test_url="https://github.com/WordPress/wordpress-develop/archive/refs/${ref_type}/${GITHUB_TAG}.zip" + local http_code=$(curl -sL -o /dev/null -w "%{http_code}" "$test_url") + if [ "$http_code" = "200" ]; then + WP_TESTS_ZIP_URL="$test_url" + break + fi + done + if [ -z "$WP_TESTS_ZIP_URL" ]; then + echo "Could not find WordPress test suite for version ${GITHUB_TAG}" + exit 1 + fi + download "$WP_TESTS_ZIP_URL" "$TMPDIR/wp-tests.zip" + unzip -q -o "$TMPDIR/wp-tests.zip" -d "$TMPDIR/wp-tests" + local WP_TESTS_EXTRACTED_DIR=$(find "$TMPDIR/wp-tests" -maxdepth 1 -mindepth 1 -type d | head -1) + cp -r "${WP_TESTS_EXTRACTED_DIR}/tests/phpunit/includes" "$WP_TESTS_DIR/includes" + cp -r "${WP_TESTS_EXTRACTED_DIR}/tests/phpunit/data" "$WP_TESTS_DIR/data" + rm -rf "$TMPDIR/wp-tests" "$TMPDIR/wp-tests.zip" + fi + + if [ ! -f wp-tests-config.php ]; then + download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php + # remove all forward slashes in the end + WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s:__DIR__ . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php + fi + +} + +recreate_db() { + shopt -s nocasematch + if [[ $1 =~ ^(y|yes)$ ]] + then + mysqladmin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA + create_db + echo "Recreated the database ($DB_NAME)." + else + echo "Leaving the existing database ($DB_NAME) in place." + fi + shopt -u nocasematch +} + +create_db() { + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA +} + +install_db() { + + if [ ${SKIP_DB_CREATE} = "true" ]; then + return 0 + fi + + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + if [ $(mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA --execute='show databases;' | grep ^$DB_NAME$) ] + then + echo "Reinstalling will delete the existing test database ($DB_NAME)" + read -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB + recreate_db $DELETE_EXISTING_DB + else + create_db + fi +} + +install_wp +install_test_suite +install_db diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..392d5d6 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,34 @@ +get_var( "SELECT count(*) FROM {$wpdb->options} WHERE autoload IN ( '" . \implode( "', '", \esc_sql( \wp_autoload_values_to_autoload() ) ) . "' )" ); + + \aaa_option_optimizer_activation(); + + $option = \get_option( 'option_optimizer' ); + + $this->assertTrue( Database::table_exists() ); + $this->assertSame( $autoloaded, (int) $option['starting_point_num'] ); + $this->assertGreaterThan( 0, $option['starting_point_kb'] ); + $this->assertNotEmpty( $option['starting_point_date'] ); + $this->assertSame( [ 'option_tracking' => 'pre_option' ], $option['settings'] ); + $this->assertNotAutoloaded( 'option_optimizer' ); + } + + /** + * Activating again keeps the existing starting point. + * + * @return void + */ + public function test_activation_preserves_an_existing_starting_point() { + $existing = [ + 'starting_point_kb' => 1.5, + 'starting_point_num' => 7, + 'starting_point_date' => '2024-01-01 00:00:00', + 'settings' => [ 'option_tracking' => 'legacy' ], + ]; + \update_option( 'option_optimizer', $existing, false ); + + \aaa_option_optimizer_activation(); + + $this->assertSame( $existing, \get_option( 'option_optimizer' ) ); + } + + /** + * Deactivation keeps the plugin option and its value. + * + * Note: the deactivation routine is also meant to stop autoloading the option, but it calls + * update_option() with an unchanged value, which returns early without touching the autoload + * flag. That is not asserted here; assert it once the routine is fixed. + * + * @return void + */ + public function test_deactivation_keeps_the_plugin_option() { + $value = [ 'starting_point_num' => 7 ]; + \update_option( 'option_optimizer', $value, false ); + + \aaa_option_optimizer_deactivation(); + + $this->assertSame( $value, \get_option( 'option_optimizer' ) ); + $this->assertNotAutoloaded( 'option_optimizer' ); + } +} diff --git a/tests/phpunit/class-database-test.php b/tests/phpunit/class-database-test.php new file mode 100644 index 0000000..a8459fe --- /dev/null +++ b/tests/phpunit/class-database-test.php @@ -0,0 +1,263 @@ +assertSame( $wpdb->prefix . 'option_optimizer_tracked', Database::get_table_name() ); + } + + /** + * The table can be dropped and created again. + * + * @return void + */ + public function test_drop_and_create_table() { + // The test suite turns CREATE/DROP TABLE into their TEMPORARY variants, which SHOW TABLES can't see. + \remove_filter( 'query', [ $this, '_create_temporary_tables' ] ); + \remove_filter( 'query', [ $this, '_drop_temporary_tables' ] ); + + $this->assertTrue( Database::table_exists() ); + + Database::drop_table(); + $this->assertFalse( Database::table_exists() ); + + Database::create_table(); + $this->assertTrue( Database::table_exists() ); + $this->assertSame( [], Database::get_tracked_options() ); + } + + /** + * Inserting nothing is a no-op. + * + * @return void + */ + public function test_batch_insert_ignores_an_empty_list() { + Database::batch_insert( [] ); + + $this->assertSame( [], Database::get_tracked_options() ); + $this->assertSame( [], Database::get_tracked_option_keys() ); + } + + /** + * Counts are stored per option. + * + * @return void + */ + public function test_batch_insert_stores_counts() { + Database::batch_insert( + [ + self::PREFIX . 'b' => 3, + self::PREFIX . 'a' => 1, + ] + ); + + $tracked = Database::get_tracked_options(); + \ksort( $tracked ); + + $this->assertSame( + [ + self::PREFIX . 'a' => 1, + self::PREFIX . 'b' => 3, + ], + $tracked + ); + } + + /** + * A second write adds to the existing count instead of replacing it. + * + * @return void + */ + public function test_batch_insert_accumulates_counts() { + Database::batch_insert( [ self::PREFIX . 'a' => 2 ] ); + Database::batch_insert( + [ + self::PREFIX . 'a' => 5, + self::PREFIX . 'b' => 1, + ] + ); + + $tracked = Database::get_tracked_options(); + + $this->assertSame( 7, $tracked[ self::PREFIX . 'a' ] ); + $this->assertSame( 1, $tracked[ self::PREFIX . 'b' ] ); + } + + /** + * Everything is written when the list is larger than one chunk. + * + * @return void + */ + public function test_batch_insert_writes_all_chunks() { + $options = []; + for ( $i = 0; $i < 25; $i++ ) { + $options[ self::PREFIX . $i ] = $i + 1; + } + + Database::batch_insert( $options, 10 ); + + $tracked = Database::get_tracked_options(); + + $this->assertCount( 25, $tracked ); + $this->assertSame( 1, $tracked[ self::PREFIX . '0' ] ); + $this->assertSame( 25, $tracked[ self::PREFIX . '24' ] ); + } + + /** + * Numeric option names (which PHP turns into integer array keys) are stored as names. + * + * @return void + */ + public function test_batch_insert_keeps_numeric_option_names() { + Database::batch_insert( + [ + '123' => 2, + self::PREFIX . 'a' => 1, + ] + ); + + $this->assertSame( 2, Database::get_tracked_options()['123'] ); + } + + /** + * Option names with quotes and SQL wildcards are stored literally. + * + * @return void + */ + public function test_batch_insert_stores_special_characters_literally() { + $name = self::PREFIX . "it's 100%_\"quoted\""; + + Database::batch_insert( [ $name => 4 ] ); + + $this->assertSame( [ $name => 4 ], Database::get_tracked_options() ); + } + + /** + * The keyed lookup contains every tracked name. + * + * @return void + */ + public function test_get_tracked_option_keys() { + Database::batch_insert( + [ + self::PREFIX . 'a' => 1, + self::PREFIX . 'b' => 9, + ] + ); + + $keys = Database::get_tracked_option_keys(); + \ksort( $keys ); + + $this->assertSame( + [ + self::PREFIX . 'a' => true, + self::PREFIX . 'b' => true, + ], + $keys + ); + } + + /** + * Clearing removes all tracked options. + * + * @return void + */ + public function test_clear_tracked_options() { + Database::batch_insert( [ self::PREFIX . 'a' => 1 ] ); + + Database::clear_tracked_options(); + + $this->assertSame( [], Database::get_tracked_options() ); + } + + /** + * Without legacy data there is nothing to migrate. + * + * @return void + */ + public function test_migration_status_without_legacy_data() { + $expected = [ + 'needs_migration' => false, + 'total' => 0, + 'remaining' => 0, + ]; + + $this->assertSame( $expected, Database::get_migration_status() ); + + \update_option( 'option_optimizer', [ 'used_options' => [] ], false ); + + $this->assertSame( $expected, Database::get_migration_status() ); + } + + /** + * Legacy data stored in the plugin option is moved to the table. + * + * @return void + */ + public function test_migrate_chunk_moves_legacy_data_to_the_table() { + $used = [ + self::PREFIX . 'a' => 2, + self::PREFIX . 'b' => 5, + ]; + + \update_option( + 'option_optimizer', + [ + 'starting_point_num' => 10, + 'used_options' => $used, + ], + false + ); + + $this->assertSame( + [ + 'needs_migration' => true, + 'total' => 2, + 'remaining' => 2, + ], + Database::get_migration_status() + ); + + $this->assertSame( + [ + 'success' => true, + 'remaining' => 0, + 'total' => 2, + ], + Database::migrate_chunk() + ); + + $tracked = Database::get_tracked_options(); + \ksort( $tracked ); + $this->assertSame( $used, $tracked ); + + // The legacy list is emptied, the rest of the option is kept, and it is still not autoloaded. + $option = \get_option( 'option_optimizer' ); + $this->assertSame( [], $option['used_options'] ); + $this->assertSame( 10, $option['starting_point_num'] ); + $this->assertNotAutoloaded( 'option_optimizer' ); + + $this->assertFalse( Database::get_migration_status()['needs_migration'] ); + } +} diff --git a/tests/phpunit/class-map-plugin-to-options-test.php b/tests/phpunit/class-map-plugin-to-options-test.php new file mode 100644 index 0000000..613afe3 --- /dev/null +++ b/tests/phpunit/class-map-plugin-to-options-test.php @@ -0,0 +1,67 @@ +assertSame( 'AAA Autoload Optimizer', $map->get_plugin_name( 'option_optimizer' ) ); + $this->assertSame( 'Akismet', $map->get_plugin_name( 'akismet_strictness' ) ); + $this->assertSame( 'Akismet', $map->get_plugin_name( 'wordpress_api_key' ) ); + } + + /** + * A prefix only matches at the start of the option name. + * + * @return void + */ + public function test_unknown_options_are_reported_as_unknown() { + $map = new Map_Plugin_To_Options(); + + $this->assertSame( 'Unknown', $map->get_plugin_name( self::PREFIX . 'nobody_owns_this' ) ); + $this->assertSame( 'Unknown', $map->get_plugin_name( self::PREFIX . 'akismet_strictness' ) ); + } + + /** + * Every entry in the shipped list has the shape the mapper relies on. + * + * @return void + */ + public function test_known_plugins_file_is_well_formed() { + $plugins = \json_decode( \file_get_contents( AAA_OPTION_OPTIMIZER_DIR . '/known-plugins/known-plugins.json' ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local file. + + $this->assertIsArray( $plugins ); + $this->assertNotEmpty( $plugins ); + + foreach ( $plugins as $slug => $plugin ) { + $this->assertIsString( $plugin['name'] ?? null, "{$slug} has no name." ); + $this->assertNotSame( '', $plugin['name'], "{$slug} has an empty name." ); + $this->assertIsArray( $plugin['option_prefixes'] ?? null, "{$slug} has no option_prefixes." ); + $this->assertNotEmpty( $plugin['option_prefixes'], "{$slug} has no option_prefixes." ); + + foreach ( $plugin['option_prefixes'] as $prefix ) { + $this->assertIsString( $prefix, "{$slug} has a non-string prefix." ); + $this->assertNotSame( '', $prefix, "{$slug} has an empty prefix, which would match every option." ); + } + } + } +} diff --git a/tests/phpunit/class-plugin-test.php b/tests/phpunit/class-plugin-test.php new file mode 100644 index 0000000..f4a7669 --- /dev/null +++ b/tests/phpunit/class-plugin-test.php @@ -0,0 +1,227 @@ +original_instance = Plugin::$instance; + $this->plugin = new Plugin(); + } + + /** + * Restore the instance WordPress loaded. + * + * @return void + */ + public function tear_down() { + Plugin::$instance = $this->original_instance; + unset( $_GET['page'] ); + + parent::tear_down(); + } + + /** + * The plugin hooks its tracking into WordPress when it loads. + * + * @return void + */ + public function test_plugin_registers_its_hooks_on_load() { + $this->assertSame( PHP_INT_MAX, \has_filter( 'pre_option', [ $this->original_instance, 'monitor_option_accesses_pre_option' ] ) ); + $this->assertSame( 10, \has_action( 'shutdown', [ $this->original_instance, 'update_tracked_options' ] ) ); + } + + /** + * Option reads are counted and written to the table on shutdown. + * + * @return void + */ + public function test_option_accesses_are_counted_and_stored() { + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'a' ); + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'a' ); + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'b' ); + + $this->plugin->update_tracked_options(); + + $tracked = Database::get_tracked_options(); + \ksort( $tracked ); + + $this->assertSame( + [ + self::PREFIX . 'a' => 2, + self::PREFIX . 'b' => 1, + ], + $tracked + ); + } + + /** + * The pre_option filter never changes the value it is given. + * + * @return void + */ + public function test_pre_option_filter_passes_the_value_through() { + $this->assertFalse( $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'a' ) ); + $this->assertSame( 'short-circuit', $this->plugin->monitor_option_accesses_pre_option( 'short-circuit', self::PREFIX . 'b' ) ); + } + + /** + * A read another plugin short-circuits never reaches the database, so it is not tracked. + * + * @return void + */ + public function test_short_circuited_reads_are_not_tracked() { + $this->plugin->monitor_option_accesses_pre_option( 'short-circuit', self::PREFIX . 'a' ); + $this->plugin->update_tracked_options(); + + $this->assertSame( [], Database::get_tracked_options() ); + } + + /** + * Names that can't exist in wp_options are not tracked. + * + * @return void + */ + public function test_impossible_option_names_are_not_tracked() { + $longest_valid = self::PREFIX . \str_repeat( 'a', 191 - \strlen( self::PREFIX ) ); + + $this->plugin->monitor_option_accesses_pre_option( false, '' ); + $this->plugin->monitor_option_accesses_pre_option( false, $longest_valid . 'a' ); + $this->plugin->monitor_option_accesses_pre_option( false, $longest_valid ); + $this->plugin->update_tracked_options(); + + $this->assertSame( [ $longest_valid => 1 ], Database::get_tracked_options() ); + } + + /** + * The trackable filter can exclude option names. + * + * @return void + */ + public function test_trackable_filter_excludes_option_names() { + $excluded = self::PREFIX . 'excluded'; + + \add_filter( + 'aaa_option_optimizer_is_trackable_option_name', + static function ( $is_trackable, $option_name ) use ( $excluded ) { + return $option_name === $excluded ? false : $is_trackable; + }, + 10, + 2 + ); + + $this->plugin->monitor_option_accesses_pre_option( false, $excluded ); + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'kept' ); + $this->plugin->update_tracked_options(); + + $this->assertSame( [ self::PREFIX . 'kept' => 1 ], Database::get_tracked_options() ); + } + + /** + * The legacy "all" hook tracking recognizes option hooks only. + * + * @return void + */ + public function test_legacy_tracking_recognizes_option_hooks() { + $this->plugin->monitor_option_accesses_legacy( 'option_' . self::PREFIX . 'a' ); + $this->plugin->monitor_option_accesses_legacy( 'default_option_' . self::PREFIX . 'b' ); + $this->plugin->monitor_option_accesses_legacy( 'option_page_capability_' . self::PREFIX . 'c' ); + $this->plugin->monitor_option_accesses_legacy( 'init' ); + $this->plugin->update_tracked_options(); + + $tracked = Database::get_tracked_options(); + \ksort( $tracked ); + + $this->assertSame( + [ + self::PREFIX . 'a' => 1, + self::PREFIX . 'b' => 1, + ], + $tracked + ); + } + + /** + * Nothing is written while the plugin's own admin page is rendered. + * + * @return void + */ + public function test_nothing_is_stored_on_the_plugin_admin_page() { + $_GET['page'] = 'aaa-option-optimizer'; + + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'a' ); + $this->plugin->update_tracked_options(); + + $this->assertSame( [], Database::get_tracked_options() ); + } + + /** + * A reset clears the table instead of writing this request's accesses. + * + * @return void + */ + public function test_reset_clears_the_tracked_options() { + Database::batch_insert( [ self::PREFIX . 'old' => 3 ] ); + + $this->plugin->monitor_option_accesses_pre_option( false, self::PREFIX . 'new' ); + $this->plugin->reset(); + $this->plugin->update_tracked_options(); + + $this->assertSame( [], Database::get_tracked_options() ); + } + + /** + * A real get_option() call is tracked through the hooks registered on load. + * + * @return void + */ + public function test_get_option_is_tracked_end_to_end() { + // Move the hooked callbacks to the instance under test, so only this test's reads are written. + \remove_filter( 'pre_option', [ $this->original_instance, 'monitor_option_accesses_pre_option' ], PHP_INT_MAX ); + \add_filter( 'pre_option', [ $this->plugin, 'monitor_option_accesses_pre_option' ], PHP_INT_MAX, 2 ); + + \get_option( self::PREFIX . 'missing' ); + \get_option( self::PREFIX . 'missing' ); + + \remove_filter( 'pre_option', [ $this->plugin, 'monitor_option_accesses_pre_option' ], PHP_INT_MAX ); + $this->plugin->update_tracked_options(); + + $tracked = Database::get_tracked_options(); + + $this->assertSame( 2, $tracked[ self::PREFIX . 'missing' ] ); + } +} diff --git a/tests/phpunit/class-rest-test.php b/tests/phpunit/class-rest-test.php new file mode 100644 index 0000000..46398e4 --- /dev/null +++ b/tests/phpunit/class-rest-test.php @@ -0,0 +1,464 @@ +user->create( [ 'role' => $role ] ); + if ( 'administrator' === $role && \is_multisite() ) { + \grant_super_admin( $user_id ); + } + \wp_set_current_user( $user_id ); + + $_SERVER['HTTP_X_WP_NONCE'] = \wp_create_nonce( 'wp_rest' ); + } + + /** + * Dispatch a request to one of the plugin's routes. + * + * @param string $route Route suffix. + * @param array $params Request parameters. + * @param string $method HTTP method. + * + * @return WP_REST_Response + */ + private function request( $route, $params = [], $method = 'POST' ) { + $request = new WP_REST_Request( $method, '/aaa-option-optimizer/v1/' . $route ); + foreach ( $params as $key => $value ) { + $request->set_param( $key, $value ); + } + + return \rest_do_request( $request ); + } + + /** + * Routes that change options, with parameters that would succeed for an administrator. + * + * @return array}> + */ + public function data_write_routes() { + $name = self::PREFIX . 'guarded'; + + return [ + 'update-autoload' => [ + 'update-autoload', + [ + 'option_name' => $name, + 'autoload' => 'yes', + ], + ], + 'set-autoload-options' => [ + 'set-autoload-options', + [ + 'option_names' => [ $name ], + 'autoload' => 'yes', + ], + ], + 'delete-option' => [ 'delete-option', [ 'option_name' => $name ] ], + 'delete-options' => [ 'delete-options', [ 'option_names' => [ $name ] ] ], + 'create-option-false' => [ 'create-option-false', [ 'option_name' => $name . '_new' ] ], + 'reset' => [ 'reset', [] ], + ]; + } + + /** + * Visitors and users without manage_options can't change anything. + * + * @dataProvider data_write_routes + * + * @param string $route Route suffix. + * @param array $params Request parameters. + * + * @return void + */ + public function test_write_routes_require_manage_options( $route, $params ) { + $name = self::PREFIX . 'guarded'; + \add_option( $name, 'value', '', false ); + + $this->assertSame( 401, $this->request( $route, $params )->get_status(), 'Logged out.' ); + + $this->log_in_as( 'editor' ); + $this->assertSame( 403, $this->request( $route, $params )->get_status(), 'Editor.' ); + + $this->assertSame( 'value', \get_option( $name ) ); + $this->assertNotAutoloaded( $name ); + $this->assertNull( $this->get_autoload_flag( $name . '_new' ) ); + } + + /** + * Autoload values and whether they should result in an autoloaded option. + * + * @return array + */ + public function data_autoload_values() { + return [ + 'yes' => [ 'yes', true ], + 'on' => [ 'on', true ], + 'auto' => [ 'auto', true ], + 'auto-on' => [ 'auto-on', true ], + 'no' => [ 'no', false ], + 'off' => [ 'off', false ], + 'auto-off' => [ 'auto-off', false ], + ]; + } + + /** + * The autoload flag is changed and the value is left alone. + * + * @dataProvider data_autoload_values + * + * @param string $autoload The requested autoload value. + * @param bool $expect_autoload Whether the option should be autoloaded afterwards. + * + * @return void + */ + public function test_update_autoload_changes_the_flag_and_keeps_the_value( $autoload, $expect_autoload ) { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'flip'; + $value = [ + 'nested' => [ 'a' => 1 ], + 'text' => "it's \"quoted\" \\ and slashed", + ]; + // Start from the opposite state. + \add_option( $name, $value, '', ! $expect_autoload ); + + $response = $this->request( + 'update-autoload', + [ + 'option_name' => $name, + 'autoload' => $autoload, + ] + ); + + $this->assertSame( 200, $response->get_status() ); + $this->assertSame( [ 'success' => true ], $response->get_data() ); + + if ( $expect_autoload ) { + $this->assertAutoloaded( $name ); + } else { + $this->assertNotAutoloaded( $name ); + } + + \wp_cache_flush(); + $this->assertSame( $value, \get_option( $name ) ); + } + + /** + * An unknown autoload value is rejected and changes nothing. + * + * @return void + */ + public function test_update_autoload_rejects_an_invalid_value() { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'invalid'; + \add_option( $name, 'value', '', true ); + + $response = $this->request( + 'update-autoload', + [ + 'option_name' => $name, + 'autoload' => 'maybe', + ] + ); + + $this->assertSame( 400, $response->get_status() ); + $this->assertSame( 'invalid_autoload_value', $response->get_data()['code'] ); + $this->assertAutoloaded( $name ); + $this->assertSame( 'value', \get_option( $name ) ); + } + + /** + * A missing option is reported, not created. + * + * @return void + */ + public function test_update_autoload_reports_a_missing_option() { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'missing'; + + $response = $this->request( + 'update-autoload', + [ + 'option_name' => $name, + 'autoload' => 'no', + ] + ); + + $this->assertSame( 404, $response->get_status() ); + $this->assertNull( $this->get_autoload_flag( $name ) ); + } + + /** + * The required parameters are enforced. + * + * @return void + */ + public function test_update_autoload_requires_its_parameters() { + $this->log_in_as( 'administrator' ); + + $this->assertSame( 400, $this->request( 'update-autoload', [ 'autoload' => 'no' ] )->get_status() ); + $this->assertSame( 400, $this->request( 'update-autoload', [ 'option_name' => self::PREFIX . 'a' ] )->get_status() ); + } + + /** + * The bulk route changes every existing option and skips missing ones. + * + * @return void + */ + public function test_set_autoload_options_changes_existing_options_only() { + $this->log_in_as( 'administrator' ); + + $first = self::PREFIX . 'bulk_1'; + $second = self::PREFIX . 'bulk_2'; + $missing = self::PREFIX . 'bulk_missing'; + $other = self::PREFIX . 'bulk_untouched'; + + \add_option( $first, 'one', '', true ); + \add_option( $second, [ 'two' ], '', true ); + \add_option( $other, 'other', '', true ); + + $response = $this->request( + 'set-autoload-options', + [ + 'option_names' => [ $first, $missing, $second ], + 'autoload' => 'no', + ] + ); + + $this->assertSame( 200, $response->get_status() ); + $this->assertNotAutoloaded( $first ); + $this->assertNotAutoloaded( $second ); + $this->assertNull( $this->get_autoload_flag( $missing ) ); + $this->assertAutoloaded( $other ); + + \wp_cache_flush(); + $this->assertSame( 'one', \get_option( $first ) ); + $this->assertSame( [ 'two' ], \get_option( $second ) ); + } + + /** + * The bulk routes need a REST nonce on top of the capability. + * + * @return void + */ + public function test_bulk_routes_require_a_nonce() { + $this->log_in_as( 'administrator' ); + unset( $_SERVER['HTTP_X_WP_NONCE'] ); + + $name = self::PREFIX . 'nonce'; + \add_option( $name, 'value', '', true ); + + $set = $this->request( + 'set-autoload-options', + [ + 'option_names' => [ $name ], + 'autoload' => 'no', + ] + ); + $this->assertSame( 403, $set->get_status() ); + + $delete = $this->request( 'delete-options', [ 'option_names' => [ $name ] ] ); + $this->assertSame( 403, $delete->get_status() ); + + $this->assertAutoloaded( $name ); + $this->assertSame( 'value', \get_option( $name ) ); + } + + /** + * The bulk route rejects an unknown autoload value. + * + * @return void + */ + public function test_set_autoload_options_rejects_an_invalid_value() { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'bulk_invalid'; + \add_option( $name, 'value', '', true ); + + $response = $this->request( + 'set-autoload-options', + [ + 'option_names' => [ $name ], + 'autoload' => 'maybe', + ] + ); + + $this->assertSame( 400, $response->get_status() ); + $this->assertAutoloaded( $name ); + } + + /** + * Deleting removes exactly the requested option. + * + * @return void + */ + public function test_delete_option() { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'delete'; + $other = self::PREFIX . 'delete_other'; + \add_option( $name, 'value' ); + \add_option( $other, 'value' ); + + $this->assertSame( 200, $this->request( 'delete-option', [ 'option_name' => $name ] )->get_status() ); + $this->assertNull( $this->get_autoload_flag( $name ) ); + $this->assertNotNull( $this->get_autoload_flag( $other ) ); + + $this->assertSame( 404, $this->request( 'delete-option', [ 'option_name' => $name ] )->get_status() ); + } + + /** + * Bulk deleting removes exactly the requested options. + * + * @return void + */ + public function test_delete_options() { + $this->log_in_as( 'administrator' ); + + $first = self::PREFIX . 'delete_1'; + $second = self::PREFIX . 'delete_2'; + $other = self::PREFIX . 'delete_other'; + \add_option( $first, 'value' ); + \add_option( $second, 'value' ); + \add_option( $other, 'value' ); + + $response = $this->request( 'delete-options', [ 'option_names' => [ $first, $second ] ] ); + + $this->assertSame( 200, $response->get_status() ); + $this->assertNull( $this->get_autoload_flag( $first ) ); + $this->assertNull( $this->get_autoload_flag( $second ) ); + $this->assertNotNull( $this->get_autoload_flag( $other ) ); + } + + /** + * A requested-but-missing option can be created as a non-autoloaded `false`. + * + * @return void + */ + public function test_create_option_false() { + $this->log_in_as( 'administrator' ); + + $name = self::PREFIX . 'created'; + + $this->assertSame( 200, $this->request( 'create-option-false', [ 'option_name' => $name ] )->get_status() ); + $this->assertNotAutoloaded( $name ); + $this->assertEmpty( \get_option( $name, 'default' ) ); + + // It can't overwrite an option that already exists. + $this->assertSame( 400, $this->request( 'create-option-false', [ 'option_name' => $name ] )->get_status() ); + } + + /** + * Autoloaded options that were never read are listed as unused; tracked ones are not. + * + * @return void + */ + public function test_unused_options_lists_untracked_autoloaded_options() { + $this->log_in_as( 'administrator' ); + + $used = self::PREFIX . 'used'; + $unused = self::PREFIX . 'unused'; + $not_autoloaded = self::PREFIX . 'not_autoloaded'; + + // Write the tracking data first: it commits, the options below are rolled back. + Database::batch_insert( [ $used => 3 ] ); + + \add_option( $used, 'value', '', true ); + \add_option( $unused, 'value', '', true ); + \add_option( $not_autoloaded, 'value', '', false ); + + $_GET['search'] = [ 'value' => self::PREFIX ]; + $response = $this->request( 'unused-options', [], 'GET' ); + unset( $_GET['search'] ); + + $this->assertSame( 200, $response->get_status() ); + + $data = $response->get_data(); + + $this->assertSame( 1, $data['recordsTotal'] ); + $this->assertSame( [ $unused ], \wp_list_pluck( $data['data'], 'name' ) ); + } + + /** + * Tracked options that are not autoloaded are listed as candidates for autoloading. + * + * @return void + */ + public function test_used_not_autoloaded_options_lists_tracked_options() { + $this->log_in_as( 'administrator' ); + + $autoloaded = self::PREFIX . 'autoloaded'; + $not_autoloaded = self::PREFIX . 'not_autoloaded'; + + Database::batch_insert( + [ + $autoloaded => 2, + $not_autoloaded => 5, + ] + ); + + \add_option( $autoloaded, 'value', '', true ); + \add_option( $not_autoloaded, 'value', '', false ); + + $_GET['search'] = [ 'value' => self::PREFIX ]; + $response = $this->request( 'used-not-autoloaded-options', [], 'GET' ); + unset( $_GET['search'] ); + + $this->assertSame( 200, $response->get_status() ); + + $rows = $response->get_data()['data']; + + $this->assertSame( [ $not_autoloaded ], \wp_list_pluck( $rows, 'name' ) ); + $this->assertSame( 5, (int) $rows[0]['count'] ); + } +} diff --git a/tests/phpunit/class-test-case.php b/tests/phpunit/class-test-case.php new file mode 100644 index 0000000..fe5b52a --- /dev/null +++ b/tests/phpunit/class-test-case.php @@ -0,0 +1,120 @@ +query( "DELETE FROM {$table_name}" ); + $wpdb->query( + $wpdb->prepare( + "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name = 'option_optimizer' OR option_name LIKE %s", + $wpdb->esc_like( self::PREFIX ) . '%', + '%' . $wpdb->esc_like( 'aaa_option_optimizer_migration_total' ) + ) + ); + $wpdb->query( 'COMMIT' ); + // phpcs:enable WordPress.DB + + \wp_cache_flush(); + } + + /** + * Read the raw autoload flag of an option, bypassing all caches and filters. + * + * @param string $option_name The option name. + * + * @return string|null The flag, or null if the option does not exist. + */ + protected function get_autoload_flag( $option_name ) { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery + return $wpdb->get_var( $wpdb->prepare( "SELECT autoload FROM {$wpdb->options} WHERE option_name = %s", $option_name ) ); + } + + /** + * Assert that an option is stored as autoloaded. + * + * @param string $option_name The option name. + * + * @return void + */ + protected function assertAutoloaded( $option_name ) { + $this->assertContains( $this->get_autoload_flag( $option_name ), \wp_autoload_values_to_autoload(), "Option {$option_name} should be autoloaded." ); + } + + /** + * Assert that an option exists and is stored as not autoloaded. + * + * @param string $option_name The option name. + * + * @return void + */ + protected function assertNotAutoloaded( $option_name ) { + $flag = $this->get_autoload_flag( $option_name ); + + $this->assertNotNull( $flag, "Option {$option_name} should exist." ); + $this->assertNotContains( $flag, \wp_autoload_values_to_autoload(), "Option {$option_name} should not be autoloaded." ); + } +} From 7a48644f9cfd60d070aba5c4f782077bdded8392 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Wed, 18 Nov 2026 12:12:22 +0100 Subject: [PATCH 2/7] Add a JS and CSS lint workflow and make both linters pass `npm run lint:css` could not run at all: the root @wordpress/stylelint-config ^22 pulled in stylelint 14, while @wordpress/scripts 30 ships a config that needs stylelint 16. Drop the redundant root config (wp-scripts brings its own) and depend on stylelint 16 directly. Apply the auto-fixes (whitespace, `bold` to `700`, one Prettier line join) and baseline the two no-descending-specificity findings, since reordering those rules would change the cascade. Co-Authored-By: Claude Fable 5.2 --- .github/workflows/js-css-lint.yml | 63 ++ css/style.css | 51 +- js/admin-script.js | 3 +- package-lock.json | 1307 ++++++++++------------------- package.json | 4 +- 5 files changed, 544 insertions(+), 884 deletions(-) create mode 100644 .github/workflows/js-css-lint.yml diff --git a/.github/workflows/js-css-lint.yml b/.github/workflows/js-css-lint.yml new file mode 100644 index 0000000..00b2a41 --- /dev/null +++ b/.github/workflows/js-css-lint.yml @@ -0,0 +1,63 @@ +name: JS and CSS Lint + +on: + # Run on relevant pushes to select branches and on all relevant pull requests. + push: + branches: + - main + - develop + - 'release/[0-9]+.[0-9]+*' + - 'hotfix/[0-9]+.[0-9]+*' + paths: + - '**.js' + - '**.css' + - 'package.json' + - 'package-lock.json' + - '.github/workflows/js-css-lint.yml' + pull_request: + paths: + - '**.js' + - '**.css' + - 'package.json' + - 'package-lock.json' + - '.github/workflows/js-css-lint.yml' + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + # The concurrency group contains the workflow name and the branch name. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + lint: + name: 'Lint JS and CSS' + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Install Node.js + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + with: + node-version: '22' + cache: 'npm' + + # --ignore-scripts: nothing in the dependency tree needs to run code to lint, + # and it skips the husky `prepare` script. + - name: Install npm dependencies + run: npm ci --ignore-scripts + + - name: Lint JS + run: npm run lint:js + + - name: Lint CSS + if: ${{ always() }} + run: npm run lint:css diff --git a/css/style.css b/css/style.css index 8f9ec8a..606b307 100644 --- a/css/style.css +++ b/css/style.css @@ -2,58 +2,79 @@ margin-left: -5px; border-spacing: 0; } + .aaa-option-optimizer-tabs .dt-layout-cell.dt-start:has(.dt-length) { display: flex; justify-content: flex-start; gap: 20px; } -.aaa_option_table td, .aaa_option_table th { +.aaa_option_table td, +.aaa_option_table th { padding: 5px 10px 5px 5px; text-align: left; } + .aaa_option_table .actions { width: 50%; text-align: right; } + .aaa_option_table .actions .button { margin-right: 10px; } + .aaa_option_table select { max-width: 20% !important; } + /* Overrider for the Source