diff --git a/.phive/phars.xml b/.phive/phars.xml index 3652b980ba87824851d9ef06767d7952121f3299..5377871a94e77927bef05d634278e66ba079d8af 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -1,9 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <phive xmlns="https://phar.io/phive"> - <phar name="phpstan" version="^1.9.2" installed="1.9.2" location="./tools/phpstan" copy="true"/> <phar name="phpunit" version="^9.5.20" installed="9.5.27" location="./tools/phpunit" copy="true"/> - <phar name="phpcs" version="^3.6.2" installed="3.7.1" location="./tools/phpcs" copy="true"/> <phar name="phpcbf" version="^3.6.2" installed="3.7.1" location="./tools/phpcbf" copy="true"/> - <phar name="grumphp" version="^1.12.0" installed="1.13.0" location="./tools/grumphp" copy="true"/> - <phar name="composer" version="^2.3.4" installed="2.4.4" location="./tools/composer" copy="true"/> + <phar name="grumphp" version="^1.12.0" installed="1.16.0" location="./tools/grumphp" copy="true"/> + <phar name="composer" version="^2.3.4" installed="2.6.5" location="./tools/composer" copy="true"/> </phive> diff --git a/composer.json b/composer.json index 27a2ab25b187be46722017b1cd7f726997d672e6..b0f3c7d968c4f9564c93bf991bad93c384ad7984 100644 --- a/composer.json +++ b/composer.json @@ -29,16 +29,25 @@ }, "require-dev": { "szepeviktor/phpstan-wordpress": "^1.1", - "wp-coding-standards/wpcs": "^2" + "wpdesk/wp-code-sniffer": "^1.2", + "phpstan/phpstan": "^1.10", + "phpstan/extension-installer": "^1.3" }, "scripts": { - "test:phpstan": "./tools/phpstan --configuration=phpstan.neon.dist --memory-limit=-1 analyze", - "test:phpcs": "./tools/phpcs", + "style:fix": "phpcbf", + "test:phpstan": "phpstan --configuration=phpstan.neon.dist --memory-limit=-1 analyze", + "test:phpcs": "phpcs", "test:phpunit": "./tools/phpunit --bootstrap tests/bootstrap.php tests", "test": [ "@test:phpcs", "@test:phpstan", "@test:phpunit" ] - } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true + } + } } diff --git a/composer.lock b/composer.lock index d7165e597e9f39504b102a2daa01ac05d086d7eb..d88aa037cf65978920d03624ab53a14f659506a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d29fb986066e09a5b6313b8201fb593", + "content-hash": "5cdb7792e111b0e3f0be5af431a13af4", "packages": [ { "name": "psr/log", @@ -58,33 +58,108 @@ } ], "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + }, + "require-dev": { + "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "time": "2023-01-05T11:28:13+00:00" + }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.1.0", + "version": "v6.3.0", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b" + "reference": "adda7609e71d5f4dc7b87c74f8ec9e3437d2e92c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/19e7966c8e70a99a4824b3e5d1526680a151f13b", - "reference": "19e7966c8e70a99a4824b3e5d1526680a151f13b", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/adda7609e71d5f4dc7b87c74f8ec9e3437d2e92c", + "reference": "adda7609e71d5f4dc7b87c74f8ec9e3437d2e92c", "shasum": "" }, - "replace": { - "giacocorsiglia/wordpress-stubs": "*" - }, "require-dev": { - "nikic/php-parser": "< 4.12.0", - "php": "~7.3 || ~8.0", - "php-stubs/generator": "^0.8.1", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0", + "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.3", - "phpstan/phpstan": "^1.2" + "phpstan/phpstan": "^1.10.12", + "phpunit/phpunit": "^9.5" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", - "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" }, "type": "library", @@ -101,22 +176,376 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.1.0" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.3.0" }, - "time": "2022-11-09T05:33:25+00:00" + "time": "2023-08-10T16:34:11+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.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "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", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "time": "2022-10-25T01:46:02+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-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", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2022-10-24T09:00:36+00:00" + }, + { + "name": "phpcsstandards/phpcsextra", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.8", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "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", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" + }, + "time": "2023-09-20T22:06:18+00:00" + }, + { + "name": "phpcsstandards/phpcsutils", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7", + "reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev" + }, + "require-dev": { + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "yoast/phpunit-polyfills": "^1.0.5 || ^2.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", + "standards", + "static analysis", + "tokens", + "utility" + ], + "support": { + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" + }, + "time": "2023-07-16T21:39:41+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a", + "reference": "f45734bfb9984c6c56c4486b71230355f066a58a", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.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", + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.3.1" + }, + "time": "2023-05-24T08:59:17+00:00" }, { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.10.37", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/058ba07e92f744d4dcf6061ae75283d0c6456f2e", + "reference": "058ba07e92f744d4dcf6061ae75283d0c6456f2e", "shasum": "" }, "require": { @@ -145,8 +574,11 @@ "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", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -162,20 +594,20 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2023-10-02T16:18:37+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -211,27 +643,28 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -240,7 +673,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -281,7 +714,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -297,35 +730,35 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v1.1.6", + "version": "v1.3.0", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "27784541f184a1ea3b6656fc8a882bb9adf45fc2" + "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/27784541f184a1ea3b6656fc8a882bb9adf45fc2", - "reference": "27784541f184a1ea3b6656fc8a882bb9adf45fc2", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9", + "reference": "5b5cc77ed51fdaf64efe3f00b5aae4b709d2cfa9", "shasum": "" }, "require": { "php": "^7.2 || ^8.0", "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", - "phpstan/phpstan": "^1.8.7", + "phpstan/phpstan": "^1.10.0", "symfony/polyfill-php73": "^1.12.0" }, "require-dev": { "composer/composer": "^2.1.14", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.1", "phpstan/phpstan-strict-rules": "^1.2", "phpunit/phpunit": "^8.0 || ^9.0", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6.1" + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" }, "type": "phpstan-extension", "extra": { @@ -354,46 +787,44 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.6" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.0" }, - "funding": [ - { - "url": "https://www.paypal.me/szepeviktor", - "type": "custom" - }, - { - "url": "https://github.com/szepeviktor", - "type": "github" - } - ], - "time": "2022-12-01T14:56:51+00:00" + "time": "2023-04-23T06:15:06+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", "shasum": "" }, "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "phpcsstandards/phpcsextra": "^1.1.0", + "phpcsstandards/phpcsutils": "^1.0.8", + "squizlabs/php_codesniffer": "^3.7.2" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", + "phpcsstandards/phpcsdevtools": "^1.2.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -410,6 +841,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -417,7 +849,51 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2020-05-13T23:57:56+00:00" + "funding": [ + { + "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "type": "custom" + } + ], + "time": "2023-09-14T07:06:09+00:00" + }, + { + "name": "wpdesk/wp-code-sniffer", + "version": "1.2.8", + "source": { + "type": "git", + "url": "https://gitlab.wpdesk.dev/wpdesk/wp-code-sniffer", + "reference": "6ba84cfac401d7e6b26fd3bcd17aa12a9447b075" + }, + "require": { + "php": ">=7.0", + "phpcompatibility/phpcompatibility-wp": "^2.1.1", + "squizlabs/php_codesniffer": "^3.6", + "wp-coding-standards/wpcs": "^3" + }, + "require-dev": { + "roave/security-advisories": "dev-latest" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "grola", + "email": "grola@wpdesk.net" + } + ], + "description": "Library for WP Desk Coding Standards in plugins.", + "homepage": "https://gitlab.com/wpdesk/wp-code-sniffer", + "keywords": [ + "admin", + "code sniffer", + "phpcs", + "wordpress" + ], + "time": "2023-09-14T07:53:00+00:00" } ], "aliases": [], @@ -430,5 +906,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 214ff803691534230e9482db608f6afb7a599b4a..5ddc2cf83fe3c37c73af15769e2d11dcd86e6205 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -8,12 +8,9 @@ ############################################################################# --> - <config - name="installed_paths" - value="vendor/wp-coding-standards/wpcs,vendor/wpdesk/wp-code-sniffer"/> - <!-- Scan all files. --> <file>./src</file> + <file>./tests</file> <!-- Only check PHP files. --> <arg name="extensions" value="php"/> @@ -27,148 +24,33 @@ <!-- Cache outcomes for better performance. Remember to add the file to .gitignore. --> <arg name="cache" value="./.phpcs-cache"/> - <!-- Always exclude all files in version management related directories. --> - <exclude-pattern>*/.git/*</exclude-pattern> - <exclude-pattern>*/.wordpress-svn/*</exclude-pattern> - - <!-- Always exclude all files in dependency related directories. --> - <exclude-pattern>*/node_modules/*</exclude-pattern> - <exclude-pattern>*/vendor(_prefixed)?/*</exclude-pattern> - - <!-- Always exclude all tests. Differences between PHPUnit, mocking libraries and WPCS make it hard to enforce some CS. --> - <exclude-pattern>*/tests/*</exclude-pattern> - - <exclude-pattern>scoper\.inc\.php$</exclude-pattern> - - <rule ref="WordPress"> - <!-- Follow PSR-4 for autoloading naming convention --> - <exclude name="WordPress.Files.FileName"/> - - <!-- WPCS demands long arrays. WPDeskCS demands short arrays. --> - <exclude name="Generic.Arrays.DisallowShortArraySyntax"/> - - <!-- Demanding Yoda conditions is stupid. --> - <exclude name="WordPress.PHP.YodaConditions"/> - - <exclude name="Squiz.Commenting.FunctionComment"/> - <exclude name="Squiz.Commenting.ClassComment"/> - <exclude name="Generic.Commenting.DocComment.MissingShort"/> - - <!-- You can use short if-else form. --> - <exclude name="WordPress.PHP.DisallowShortTernary"/> - - <!-- If a conscious choice has been made for a non-strict comparison, that's ok. - I.e. when `strict` has been explicitly set to `false` in an array comparison, - it will be allowed. --> - <exclude name="WordPress.PHP.StrictInArray.FoundNonStrictFalse"/> - - <exclude name="WordPress.WP.AlternativeFunctions" /> - - <!-- Sometimes it's better not to use user's timezone. --> - <exclude name="WordPress.DateTime.RestrictedFunctions.date_date" /> - </rule> - - <!-- Allow slash in hook name. --> - <rule ref="WordPress.NamingConventions.ValidHookName"> - <properties> - <property name="additionalWordDelimiters" value="/"/> - </properties> - </rule> - - <!-- Template files should have comment with passed variables. --> - <rule ref="Squiz.Commenting.FileComment"> - <include-pattern>*/templates/*</include-pattern> - <exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/> - </rule> - - <rule ref="WordPress.Arrays.MultipleStatementAlignment"> - <type>error</type> - <properties> - <!-- No need to adjust alignment of large arrays when the item with the largest key is removed. --> - <property name="exact" value="false"/> - <!-- Don't align multi-line items if ALL items in the array are multi-line. --> - <property name="alignMultilineItems" value="!=100"/> - <!-- Array Assignment operator should always be on the same line as the array key. --> - <property name="ignoreNewlines" value="false"/> - </properties> - </rule> - - <!-- In contrast to WPCS: demand short arrays. --> - <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> - - <!-- Check the complexity of code in advance to prevent too complex structures. --> - <rule ref="Generic.Metrics.CyclomaticComplexity"> - <properties> - <property name="complexity" value="15"/> - <property name="absoluteComplexity" value="30"/> - </properties> - </rule> - - <rule ref="Generic.Metrics.NestingLevel"> - <properties> - <property name="nestingLevel" value="6" /> - <property name="absoluteNestingLevel" value="10" /> - </properties> - </rule> - <!-- ############################################################################# - ADD SOME SPECIFIC EXTRA SNIFFS - These may make it into WPCS at some point. If so, they can be removed here. + USE THE WPDeskCS RULESET ############################################################################# --> - <!-- CS: no blank line between the content of a function and a function close brace.--> - <rule ref="PSR2.Methods.FunctionClosingBrace"/> - - <!-- CS: ensure exactly one blank line before each property declaration. --> - <rule ref="Squiz.WhiteSpace.MemberVarSpacing"/> - <!-- CS: don't allow "// end class" comments and the likes. --> - <rule ref="PSR12.Classes.ClosingBrace"/> + <!-- Define plugin text domain for i18n. --> + <config name="text_domain" value="shopmagic-for-woocommerce"/> - <!-- CS: enforce consistent indentation of chained object method calls. --> - <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"> - <properties> - <property name="multilevel" value="true"/> - </properties> - </rule> - - <!-- Error prevention: Ensure no git conflicts make it into the code base. --> - <!-- PHPCS 3.4.0: This sniff will be added to WPCS in due time and can then be removed from this ruleset. - Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/1500 --> - <rule ref="Generic.VersionControl.GitMergeConflict"/> - - <!-- CS: no space between an increment/decrement operator and the variable it applies to. --> - <!-- PHPCS 3.4.0: This sniff will be added to WPCS in due time and can then be removed from this ruleset. - Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/1511 --> - <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/> - - <!-- QA: Function declarations should not contain parameters which will never be used. --> - <!-- PHPCS 3.4.0: This sniff will be added to WPCS in due time and can then be removed from this ruleset. - Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/1510 --> - <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found"/> - <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed"/> + <!-- This value should be aligned with WordPress support version declared in plugin header --> + <config name="minimum_supported_wp_version" value="5.0"/> - <!-- CS: Ensure consistent whitespace around spread operators. --> - <!-- PHPCS 3.5.0: This sniff will be added to WPCS in due time and can then be removed from this ruleset. - Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/1762 --> - <rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter"/> + <!-- Set value aligned with supported PHP Version for PHPCompatibilityWP check. --> + <config name="testVersion" value="7.1-"/> - <!-- CS: Disallow a leading backslash at the start of an import use statement. --> - <!-- PHPCS 3.5.0: This sniff may be added to WPCS in due time and can then be removed from this ruleset. --> - <rule ref="PSR12.Files.ImportStatement"/> + <rule ref="WPDeskPlugin"/> - <!-- CS: Enforces that a PHP open tag is on a line by itself when used at the start of a PHP-only file. --> - <!-- PHPCS 3.5.0: This sniff may be added to WPCS in due time and can then be removed from this ruleset. --> - <rule ref="PSR12.Files.OpenTag"/> - - <!-- ##### Documentation Sniffs vs empty index files ##### --> + <!-- + ############################################################################## + CUSTOM RULES + ############################################################################## + --> + <rule ref="Squiz.ControlStructures.InlineIfDeclaration"> + <exclude name="Squiz.ControlStructures.InlineIfDeclaration.NoBrackets"/> + </rule> - <!-- Exclude the 'empty' index files from some documentation checks --> - <rule ref="Squiz.Commenting.InlineComment.NoSpaceBefore"> - <exclude-pattern>*/index\.php$</exclude-pattern> - </rule> - <rule ref="Squiz.Commenting.FileComment.WrongStyle"> - <exclude-pattern>*/index\.php$</exclude-pattern> + <rule ref="Squiz.Commenting.ClassComment"> + <exclude name="Squiz.Commenting.ClassComment.Missing"/> </rule> </ruleset> diff --git a/phpstan.neon.dist b/phpstan.neon.dist index b43f9fe5ca986d384b86fd059e59d366f5632493..24f8e2646ff50b13e75e65ba46a77846ba2567ed 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,3 @@ -includes: - - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: level: 8 paths: diff --git a/tools/composer b/tools/composer index 6d799ebd6f101824bfc6c5b1f4970f3783d90a5c..e766506542d36f55d0200e9986b5c33a6d2919a1 100755 Binary files a/tools/composer and b/tools/composer differ diff --git a/tools/grumphp b/tools/grumphp index 02735fa8fc26707893672185512d82d4131dcff1..bbe7627db80a0c3634428efc5097868f1af047f0 100755 Binary files a/tools/grumphp and b/tools/grumphp differ diff --git a/tools/phpcs b/tools/phpcs deleted file mode 100755 index f9107c57bc1ec335e786766a5c7dfbd8ba30dabf..0000000000000000000000000000000000000000 Binary files a/tools/phpcs and /dev/null differ diff --git a/tools/phpstan b/tools/phpstan deleted file mode 100755 index 112187c78612dad700e9b8898bd18f2ffae9e510..0000000000000000000000000000000000000000 Binary files a/tools/phpstan and /dev/null differ