From a47157608202edd6c0920999b2f6eb87d5d40d47 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:30:14 +0000 Subject: [PATCH 1/8] feat(CPNT-2249): adds php-compatibility-wp package --- composer.json | 3 +- composer.lock | 176 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 177 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f77eb16..e66b36b 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ }, "require": { "automattic/vipwpcs": "^3.0", - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "phpcompatibility/phpcompatibility-wp": "*" } } diff --git a/composer.lock b/composer.lock index 944ce6d..37ae986 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": "a10fb35ac97b798504dc9bb78722cd0c", + "content-hash": "86044defe768587a5296cd833da08604", "packages": [ { "name": "automattic/vipwpcs", @@ -138,6 +138,180 @@ }, "time": "2023-01-05T11:28:13+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.2.1", From f63427e683b55c1a5af09dc77c327757eb3ea802 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:33:20 +0000 Subject: [PATCH 2/8] feat(CPNT-2249): fix PSR2 typo --- NewsUK/ruleset.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index 0504b6f..9ee9b7d 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -58,8 +58,8 @@ - - + + From a76664890e1b0c3abd2da4568f1c62c7a99043bb Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:41:16 +0000 Subject: [PATCH 3/8] feat(CPNT-2249): add psr2r package --- NewsUK/ruleset.xml | 4 +- composer.json | 3 +- composer.lock | 233 ++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 236 insertions(+), 4 deletions(-) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index 9ee9b7d..0504b6f 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -58,8 +58,8 @@ - - + + diff --git a/composer.json b/composer.json index e66b36b..7da168d 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "require": { "automattic/vipwpcs": "^3.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "phpcompatibility/phpcompatibility-wp": "*" + "phpcompatibility/phpcompatibility-wp": "*", + "fig-r/psr2r-sniffer": "^2.0" } } diff --git a/composer.lock b/composer.lock index 37ae986..f6ca659 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": "86044defe768587a5296cd833da08604", + "content-hash": "458e7ec1fc31627eb131fe8b66934d4b", "packages": [ { "name": "automattic/vipwpcs", @@ -138,6 +138,125 @@ }, "time": "2023-01-05T11:28:13+00:00" }, + { + "name": "fig-r/psr2r-sniffer", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig-rectified/psr2r-sniffer.git", + "reference": "34ff6edfbb6e9b297cc50a2c8cd6917e2e0f5a42" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig-rectified/psr2r-sniffer/zipball/34ff6edfbb6e9b297cc50a2c8cd6917e2e0f5a42", + "reference": "34ff6edfbb6e9b297cc50a2c8cd6917e2e0f5a42", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "php-collective/code-sniffer": "^0.1.0", + "slevomat/coding-standard": "^8.3.0", + "squizlabs/php_codesniffer": "^3.7.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.0.0", + "phpunit/phpunit": "^10.3" + }, + "bin": [ + "bin/tokenize", + "bin/sniff" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PSR2R\\": "PSR2R/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mark Scherer", + "homepage": "https://www.dereuromark.de", + "role": "Contributor" + } + ], + "description": "Code-Sniffer, Auto-Fixer and Tokenizer for PSR2-R", + "keywords": [ + "codesniffer", + "cs", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-fig-rectified/psr2r-sniffer/issues", + "source": "https://github.com/php-fig-rectified/psr2r-sniffer/tree/2.0.0" + }, + "time": "2023-10-15T01:05:11+00:00" + }, + { + "name": "php-collective/code-sniffer", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-collective/code-sniffer.git", + "reference": "ad27be14817611dc73b01156e447768caf2c7785" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-collective/code-sniffer/zipball/ad27be14817611dc73b01156e447768caf2c7785", + "reference": "ad27be14817611dc73b01156e447768caf2c7785", + "shasum": "" + }, + "require": { + "php": ">=7.4", + "slevomat/coding-standard": "^7.2.0 || ^8.0.1", + "squizlabs/php_codesniffer": "^3.6.2" + }, + "require-dev": { + "phpstan/phpstan": "^1.0.0", + "phpunit/phpunit": "^9.5" + }, + "bin": [ + "bin/tokenize" + ], + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PhpCollective\\": "PhpCollective/", + "PhpCollectiveStrict\\": "PhpCollectiveStrict/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "The PHP Collective", + "homepage": "https://github.com/php-collective" + }, + { + "name": "Spryker", + "homepage": "https://spryker.com" + } + ], + "description": "PhpCollective Code Sniffer Standards", + "homepage": "https://github.com/php-collective/code-sniffer", + "keywords": [ + "codesniffer", + "framework", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/php-collective/code-sniffer/issues", + "source": "https://github.com/php-collective/code-sniffer" + }, + "time": "2023-10-07T20:39:28+00:00" + }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", @@ -478,6 +597,53 @@ ], "time": "2023-12-08T14:50:00+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "1.25.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bd84b629c8de41aa2ae82c067c955e06f1b00240", + "reference": "bd84b629c8de41aa2ae82c067c955e06f1b00240", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^4.15", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1.5", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.25.0" + }, + "time": "2024-01-04T17:06:16+00:00" + }, { "name": "sirbrillig/phpcs-variable-analysis", "version": "v2.11.17", @@ -536,6 +702,71 @@ }, "time": "2023-08-05T23:46:11+00:00" }, + { + "name": "slevomat/coding-standard", + "version": "8.14.1", + "source": { + "type": "git", + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", + "shasum": "" + }, + "require": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.7.1" + }, + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.37", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.14", + "phpstan/phpstan-strict-rules": "1.5.1", + "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" + ], + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" + }, + "funding": [ + { + "url": "https://github.com/kukulich", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" + } + ], + "time": "2023-10-08T07:28:08+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.8.0", From 8e852682af21f67000f5954ab3ce4bb62ffa3479 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:45:44 +0000 Subject: [PATCH 4/8] feat(CPNT-2249): remove deprecated ruleset --- NewsUK/ruleset.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index 0504b6f..965cd57 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -59,7 +59,6 @@ - From c02a0479b3924c6e6f0b2f7736cbdcf212890a20 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:53:26 +0000 Subject: [PATCH 5/8] feat(CPNT-2249): adds stricttype ruleset --- NewsUK/ruleset.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index 965cd57..1e6c36b 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -60,6 +60,8 @@ + + . From 236f907e295502237e5016316a8741e5c8f436b3 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Mon, 15 Jan 2024 18:57:26 +0000 Subject: [PATCH 6/8] feat(CPNT-2249): get version of compatibility package --- composer.json | 2 +- composer.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 7da168d..8704568 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "automattic/vipwpcs": "^3.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "phpcompatibility/phpcompatibility-wp": "*", + "phpcompatibility/phpcompatibility-wp": "^2.1", "fig-r/psr2r-sniffer": "^2.0" } } diff --git a/composer.lock b/composer.lock index f6ca659..168fb4b 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": "458e7ec1fc31627eb131fe8b66934d4b", + "content-hash": "baa86f9a18de7c246769f6810b277cd4", "packages": [ { "name": "automattic/vipwpcs", @@ -769,16 +769,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/14f5fff1e64118595db5408e946f3a22c75807f7", + "reference": "14f5fff1e64118595db5408e946f3a22c75807f7", "shasum": "" }, "require": { @@ -788,11 +788,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -845,7 +845,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-01-11T20:47:48+00:00" }, { "name": "wp-coding-standards/wpcs", From cf1da9d477bc84d1e3305e97ed8ade8cb55cd671 Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Tue, 16 Jan 2024 15:13:00 +0000 Subject: [PATCH 7/8] feat(CPNT-2249): adds slevomat/coding-standard package --- NewsUK/ruleset.xml | 6 +++++- composer.json | 3 ++- composer.lock | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index 1e6c36b..af2238b 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -60,7 +60,11 @@ - + + + + + diff --git a/composer.json b/composer.json index 8704568..cf05313 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "automattic/vipwpcs": "^3.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "phpcompatibility/phpcompatibility-wp": "^2.1", - "fig-r/psr2r-sniffer": "^2.0" + "fig-r/psr2r-sniffer": "^2.0", + "slevomat/coding-standard": "^8.14" } } diff --git a/composer.lock b/composer.lock index 168fb4b..4f9d4ff 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": "baa86f9a18de7c246769f6810b277cd4", + "content-hash": "975320a5f1f0c802c38716dd6e50bcf9", "packages": [ { "name": "automattic/vipwpcs", From f70d655e59a9cb2904f30bf77005965a19f31eae Mon Sep 17 00:00:00 2001 From: Mohan Raj Date: Tue, 16 Jan 2024 15:32:18 +0000 Subject: [PATCH 8/8] feat(CPNT-2249): revert declarefirstline rule --- NewsUK/ruleset.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/NewsUK/ruleset.xml b/NewsUK/ruleset.xml index af2238b..1e6c36b 100644 --- a/NewsUK/ruleset.xml +++ b/NewsUK/ruleset.xml @@ -60,11 +60,7 @@ - - - - - +