From 28d3405194823e15a0172b847d8886f22f9779ff Mon Sep 17 00:00:00 2001 From: Calypso Bot Date: Mon, 7 Oct 2024 20:58:44 +0200 Subject: [PATCH] Update dependency mediawiki/mediawiki-codesniffer to v44 (#39648) * Update dependency mediawiki/mediawiki-codesniffer to v44 * Update monorepo root composer.lock. New versions of various other phpcs packages. * MediaWiki.Usage.DoubleNotOperator has been removed upstream. * Disable Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses pending discussion * Fix new Squiz.Commenting.FunctionComment.MissingParamType sniffs --------- Co-authored-by: Renovate Bot Co-authored-by: Brad Jorsch --- composer.lock | 161 ++++++++++-------- .../packages/codesniffer/Jetpack/ruleset.xml | 6 +- ...ovate-mediawiki-mediawiki-codesniffer-44.x | 4 + ...ate-mediawiki-mediawiki-codesniffer-44.x#2 | 4 + ...ate-mediawiki-mediawiki-codesniffer-44.x#4 | 4 + projects/packages/codesniffer/composer.json | 2 +- .../tests/files/mediawiki-imports.php.fixed | 2 +- .../tests/files/mediawiki-imports.php.report | 2 +- .../tests/files/mediawiki-imports.php.tolint | 2 +- ...ovate-mediawiki-mediawiki-codesniffer-44.x | 4 + .../src/types/class-type-assoc-array.php | 2 +- .../wp-js-data-sync/.phan/baseline.php | 5 +- ...ovate-mediawiki-mediawiki-codesniffer-44.x | 4 + .../src/class-data-sync-entry-adapter.php | 4 +- .../wp-js-data-sync/src/class-registry.php | 23 +-- .../src/endpoints/class-action-endpoint.php | 10 +- ...ovate-mediawiki-mediawiki-codesniffer-44.x | 4 + .../_support/Helper/JPCRM_Acceptance.php | 6 +- .../_support/Helper/RunProcess.php | 6 +- 19 files changed, 148 insertions(+), 107 deletions(-) create mode 100644 projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x create mode 100644 projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#2 create mode 100644 projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#4 create mode 100644 projects/packages/schema/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x create mode 100644 projects/packages/wp-js-data-sync/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x create mode 100644 projects/plugins/crm/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x diff --git a/composer.lock b/composer.lock index eecca3d0ea5b9..cdfe2994a8446 100644 --- a/composer.lock +++ b/composer.lock @@ -60,12 +60,12 @@ "dist": { "type": "path", "url": "projects/packages/codesniffer", - "reference": "891b1551e10d864bc4654bd034ce0487ad849425" + "reference": "7545c2efd2ce1a5f8cb85419035b3f1e952be125" }, "require": { "automattic/vipwpcs": "^3.0", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "mediawiki/mediawiki-codesniffer": "^43.0", + "mediawiki/mediawiki-codesniffer": "^44.0", "php": ">=7.4", "phpcompatibility/phpcompatibility-wp": "^2.1", "sirbrillig/phpcs-variable-analysis": "^2.10", @@ -360,16 +360,16 @@ }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -421,7 +421,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -437,7 +437,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/spdx-licenses", @@ -757,34 +757,34 @@ }, { "name": "mediawiki/mediawiki-codesniffer", - "version": "v43.0.0", + "version": "v44.0.0", "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-tools-codesniffer.git", - "reference": "c559bc02e87b0a969b6ed7380d7fa1d02738158b" + "reference": "86c56877214ad5216a0d1c6c0d3a9c72edce4c08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/mediawiki-tools-codesniffer/zipball/c559bc02e87b0a969b6ed7380d7fa1d02738158b", - "reference": "c559bc02e87b0a969b6ed7380d7fa1d02738158b", + "url": "https://api.github.com/repos/wikimedia/mediawiki-tools-codesniffer/zipball/86c56877214ad5216a0d1c6c0d3a9c72edce4c08", + "reference": "86c56877214ad5216a0d1c6c0d3a9c72edce4c08", "shasum": "" }, "require": { - "composer/semver": "3.3.2 || 3.4.0", + "composer/semver": "3.3.2 || 3.4.0 || 3.4.2", "composer/spdx-licenses": "~1.5.2", "ext-json": "*", "ext-mbstring": "*", "php": ">=7.4.0", - "phpcsstandards/phpcsextra": "1.1.2", - "squizlabs/php_codesniffer": "3.8.1", + "phpcsstandards/phpcsextra": "1.2.1", + "squizlabs/php_codesniffer": "3.9.0", "symfony/polyfill-php80": "^1.26.0" }, "require-dev": { - "mediawiki/mediawiki-phan-config": "0.12.1", - "mediawiki/minus-x": "1.1.1", + "mediawiki/mediawiki-phan-config": "0.14.0", + "mediawiki/minus-x": "1.1.3", "php-parallel-lint/php-console-highlighter": "1.0.0", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpunit/phpunit": "9.5.28" + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpunit/phpunit": "9.6.16" }, "type": "phpcodesniffer-standard", "autoload": { @@ -804,9 +804,9 @@ "mediawiki" ], "support": { - "source": "https://github.com/wikimedia/mediawiki-tools-codesniffer/tree/v43.0.0" + "source": "https://github.com/wikimedia/mediawiki-tools-codesniffer/tree/v44.0.0" }, - "time": "2024-01-29T16:06:37+00:00" + "time": "2024-08-10T11:11:32+00:00" }, { "name": "microsoft/tolerant-php-parser", @@ -1427,29 +1427,29 @@ }, { "name": "phpcsstandards/phpcsextra", - "version": "1.1.2", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5" + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/746c3190ba8eb2f212087c947ba75f4f5b9a58d5", - "reference": "746c3190ba8eb2f212087c947ba75f4f5b9a58d5", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", + "reference": "11d387c6642b6e4acaf0bd9bf5203b8cca1ec489", "shasum": "" }, "require": { "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.1" + "phpcsstandards/phpcsutils": "^1.0.9", + "squizlabs/php_codesniffer": "^3.8.0" }, "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" + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -1484,28 +1484,43 @@ ], "support": { "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, - "time": "2023-09-20T22:06:18+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2023-12-08T16:49:07+00:00" }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.9", + "version": "1.0.11", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70" + "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c457da9dabb60eb7106dd5e3c05132b1a6539c6a", + "reference": "c457da9dabb60eb7106dd5e3c05132b1a6539c6a", "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.8.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.9.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", @@ -1574,7 +1589,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T14:50:00+00:00" + "time": "2024-04-24T11:47:18+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1753,16 +1768,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.30.1", + "version": "1.32.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e" + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/51b95ec8670af41009e2b2b56873bad96682413e", - "reference": "51b95ec8670af41009e2b2b56873bad96682413e", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", "shasum": "" }, "require": { @@ -1794,9 +1809,9 @@ "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.30.1" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.32.0" }, - "time": "2024-09-07T20:13:05+00:00" + "time": "2024-09-26T07:23:32+00:00" }, { "name": "psr/container", @@ -1853,16 +1868,16 @@ }, { "name": "psr/log", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "79dff0b268932c640297f5208d6298f71855c03e" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/79dff0b268932c640297f5208d6298f71855c03e", - "reference": "79dff0b268932c640297f5208d6298f71855c03e", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -1897,9 +1912,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.1" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2024-08-21T13:31:24+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { "name": "sabre/event", @@ -2081,16 +2096,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.1", + "version": "3.9.0", "source": { "type": "git", "url": "https://github.com/Automattic/PHP_CodeSniffer", - "reference": "4f6b463a07f12c38713e0c2ea21612a25cdc4d03" + "reference": "0ba28e73a426e908c0e910edc3924848ed263c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/PHP_CodeSniffer/zipball/4f6b463a07f12c38713e0c2ea21612a25cdc4d03", - "reference": "4f6b463a07f12c38713e0c2ea21612a25cdc4d03", + "url": "https://api.github.com/repos/Automattic/PHP_CodeSniffer/zipball/0ba28e73a426e908c0e910edc3924848ed263c56", + "reference": "0ba28e73a426e908c0e910edc3924848ed263c56", "shasum": "" }, "require": { @@ -2174,16 +2189,16 @@ }, { "name": "symfony/console", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111" + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1eed7af6961d763e7832e874d7f9b21c3ea9c111", - "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111", + "url": "https://api.github.com/repos/symfony/console/zipball/0fa539d12b3ccf068a722bbbffa07ca7079af9ee", + "reference": "0fa539d12b3ccf068a722bbbffa07ca7079af9ee", "shasum": "" }, "require": { @@ -2247,7 +2262,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.4" + "source": "https://github.com/symfony/console/tree/v7.1.5" }, "funding": [ { @@ -2263,7 +2278,7 @@ "type": "tidelift" } ], - "time": "2024-08-15T22:48:53+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2815,16 +2830,16 @@ }, { "name": "symfony/string", - "version": "v7.1.4", + "version": "v7.1.5", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b" + "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/6cd670a6d968eaeb1c77c2e76091c45c56bc367b", - "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b", + "url": "https://api.github.com/repos/symfony/string/zipball/d66f9c343fa894ec2037cc928381df90a7ad4306", + "reference": "d66f9c343fa894ec2037cc928381df90a7ad4306", "shasum": "" }, "require": { @@ -2882,7 +2897,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.4" + "source": "https://github.com/symfony/string/tree/v7.1.5" }, "funding": [ { @@ -2898,7 +2913,7 @@ "type": "tidelift" } ], - "time": "2024-08-12T09:59:40+00:00" + "time": "2024-09-20T08:28:38+00:00" }, { "name": "tysonandre/var_representation_polyfill", @@ -3022,16 +3037,16 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", "shasum": "" }, "require": { @@ -3040,16 +3055,16 @@ "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.10", + "squizlabs/php_codesniffer": "^3.9.0" }, "require-dev": { "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.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -3080,11 +3095,11 @@ }, "funding": [ { - "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "url": "https://opencollective.com/php_codesniffer", "type": "custom" } ], - "time": "2023-09-14T07:06:09+00:00" + "time": "2024-03-25T16:39:00+00:00" } ], "aliases": [], diff --git a/projects/packages/codesniffer/Jetpack/ruleset.xml b/projects/packages/codesniffer/Jetpack/ruleset.xml index 8bbed048e9829..98a0e15c6b1d8 100644 --- a/projects/packages/codesniffer/Jetpack/ruleset.xml +++ b/projects/packages/codesniffer/Jetpack/ruleset.xml @@ -17,7 +17,6 @@ - @@ -122,4 +121,9 @@ + + + + + diff --git a/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x new file mode 100644 index 0000000000000..d50cd3140f5e4 --- /dev/null +++ b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x @@ -0,0 +1,4 @@ +Significance: major +Type: changed + +Use mediawiki/mediawiki-codesniffer v44. diff --git a/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#2 b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#2 new file mode 100644 index 0000000000000..2bdb24af55f5f --- /dev/null +++ b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#2 @@ -0,0 +1,4 @@ +Significance: minor +Type: removed + +`MediaWiki.Usage.DoubleNotOperator` has been removed. `Universal.CodeAnalysis.NoDoubleNegative.FoundDouble`, which serves the same purpose, will be included via the WordPress-Extra ruleset v3.1.0. diff --git a/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#4 b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#4 new file mode 100644 index 0000000000000..f49fbffda61e3 --- /dev/null +++ b/projects/packages/codesniffer/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x#4 @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Disable new `Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence.MissingParentheses` sniff for now, pending discussion. diff --git a/projects/packages/codesniffer/composer.json b/projects/packages/codesniffer/composer.json index 001e510aadd7d..3f29498eb890f 100644 --- a/projects/packages/codesniffer/composer.json +++ b/projects/packages/codesniffer/composer.json @@ -14,7 +14,7 @@ "require": { "php": ">=7.4", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "mediawiki/mediawiki-codesniffer": "^43.0", + "mediawiki/mediawiki-codesniffer": "^44.0", "phpcompatibility/phpcompatibility-wp": "^2.1", "sirbrillig/phpcs-variable-analysis": "^2.10", "wp-coding-standards/wpcs": "^3.0", diff --git a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.fixed b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.fixed index a2229e80ccfc0..71a6316a64f69 100644 --- a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.fixed +++ b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.fixed @@ -41,7 +41,7 @@ class Dummy_Class { require_once 'bar.php'; $u->clone = clone $x; - // MediaWiki.Usage.DoubleNotOperator. + // Universal.CodeAnalysis.NoDoubleNegative.FoundDouble (formerly MediaWiki.Usage.DoubleNotOperator). $u->bool = (bool) $u->bool; // MediaWiki.Usage.ForbiddenFunctions diff --git a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.report b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.report index e64da1fbabce3..da3dc8a8f6cdb 100644 --- a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.report +++ b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.report @@ -8,7 +8,7 @@ 44 | WARNING | [x] require_once keyword must not be used as a function. (MediaWiki.ExtraCharacters.ParenthesesAroundKeyword.ParenthesesAroundKeywords) 44 | ERROR | [ ] Absolute include path must be used. Use `get_template_directory()`, `get_stylesheet_directory()` or `plugin_dir_path()`. (WordPressVIPMinimum.Files.IncludingFile.NotAbsolutePath) 45 | WARNING | [x] clone keyword must not be used as a function. (MediaWiki.ExtraCharacters.ParenthesesAroundKeyword.ParenthesesAroundKeywords) - 48 | WARNING | [x] Use (bool) instead of !! (MediaWiki.Usage.DoubleNotOperator.DoubleNotOperator) + 48 | ERROR | [x] Double negative detected. Use a (bool) cast instead. Found: ! ! (Universal.CodeAnalysis.NoDoubleNegative.FoundDouble) 51 | WARNING | [x] Use rtrim() instead of chop (MediaWiki.Usage.ForbiddenFunctions.chop) 52 | WARNING | [x] Use mb_strlen() instead of mbstrlen (MediaWiki.Usage.ForbiddenFunctions.mbstrlen) 57 | ERROR | [ ] Found slow in_array( …, array_keys() ), should be array_key_exists() or isset() (MediaWiki.Usage.InArrayUsage.Found) diff --git a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.tolint b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.tolint index fcece79d431a9..f12651ad44ce5 100644 --- a/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.tolint +++ b/projects/packages/codesniffer/tests/php/tests/files/mediawiki-imports.php.tolint @@ -44,7 +44,7 @@ class Dummy_Class { require_once( 'bar.php' ); $u->clone = clone( $x ); - // MediaWiki.Usage.DoubleNotOperator. + // Universal.CodeAnalysis.NoDoubleNegative.FoundDouble (formerly MediaWiki.Usage.DoubleNotOperator). $u->bool = ! ! $u->bool; // MediaWiki.Usage.ForbiddenFunctions diff --git a/projects/packages/schema/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x b/projects/packages/schema/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x new file mode 100644 index 0000000000000..d2f961274a04b --- /dev/null +++ b/projects/packages/schema/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix missing types in phpdoc comments. diff --git a/projects/packages/schema/src/types/class-type-assoc-array.php b/projects/packages/schema/src/types/class-type-assoc-array.php index 736462c28ec66..a2a1ac607cd51 100644 --- a/projects/packages/schema/src/types/class-type-assoc-array.php +++ b/projects/packages/schema/src/types/class-type-assoc-array.php @@ -31,7 +31,7 @@ public function __construct( $assoc_parser_array ) { * It will then loop over each key that was provided in the constructor * and pull the value based on that key from the $data array. * - * @param $value mixed[] + * @param array|object $value * * @return array * @throws Schema_Error - If the $data passed to it is not an associative array. diff --git a/projects/packages/wp-js-data-sync/.phan/baseline.php b/projects/packages/wp-js-data-sync/.phan/baseline.php index 44ed7a44c447e..3dd793e76e9c2 100644 --- a/projects/packages/wp-js-data-sync/.phan/baseline.php +++ b/projects/packages/wp-js-data-sync/.phan/baseline.php @@ -14,17 +14,14 @@ // PhanImpossibleCondition : 1 occurrence // PhanPluginSimplifyExpressionBool : 1 occurrence // PhanRedundantCondition : 1 occurrence - // PhanTypeMismatchProperty : 1 occurrence - // PhanUndeclaredTypeParameter : 1 occurrence // PhanUnreferencedUseNormal : 1 occurrence // Currently, file_suppressions and directory_suppressions are the only supported suppressions 'file_suppressions' => [ 'src/class-data-sync-entry-adapter.php' => ['PhanParamTooFew'], 'src/class-ds-utils.php' => ['PhanImpossibleCondition', 'PhanRedundantCondition'], - 'src/class-registry.php' => ['PhanUndeclaredTypeParameter'], 'src/contracts/interface-lazy-entry.php' => ['PhanUnreferencedUseNormal'], - 'src/endpoints/class-action-endpoint.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchProperty'], + 'src/endpoints/class-action-endpoint.php' => ['PhanPluginDuplicateConditionalNullCoalescing'], 'src/endpoints/class-endpoint.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool'], ], // 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed. diff --git a/projects/packages/wp-js-data-sync/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x b/projects/packages/wp-js-data-sync/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x new file mode 100644 index 0000000000000..d2f961274a04b --- /dev/null +++ b/projects/packages/wp-js-data-sync/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Fix missing types in phpdoc comments. diff --git a/projects/packages/wp-js-data-sync/src/class-data-sync-entry-adapter.php b/projects/packages/wp-js-data-sync/src/class-data-sync-entry-adapter.php index aa69f112e68dc..f8db587d6e5b4 100644 --- a/projects/packages/wp-js-data-sync/src/class-data-sync-entry-adapter.php +++ b/projects/packages/wp-js-data-sync/src/class-data-sync-entry-adapter.php @@ -42,8 +42,8 @@ final class Data_Sync_Entry_Adapter implements Data_Sync_Entry { * The constructor accepts any entry that subscribes to at least "Entry_Can_Get", but can also * subscribe to any of the other Entry_Can_* interfaces. * - * @param $entry Entry_Can_Get - The data sync entry. - * @param $schema Parser - The schema for the data sync entry. + * @param Entry_Can_Get $entry - The data sync entry. + * @param Parser $schema - The schema for the data sync entry. */ public function __construct( $entry, $schema ) { $this->entry = $entry; diff --git a/projects/packages/wp-js-data-sync/src/class-registry.php b/projects/packages/wp-js-data-sync/src/class-registry.php index ca750b34c630e..6c4036a9fa012 100644 --- a/projects/packages/wp-js-data-sync/src/class-registry.php +++ b/projects/packages/wp-js-data-sync/src/class-registry.php @@ -9,6 +9,7 @@ namespace Automattic\Jetpack\WP_JS_Data_Sync; +use Automattic\Jetpack\Schema\Schema_Parser; use Automattic\Jetpack\WP_JS_Data_Sync\Contracts\Data_Sync_Entry; use Automattic\Jetpack\WP_JS_Data_Sync\Endpoints\Action_Endpoint; use Automattic\Jetpack\WP_JS_Data_Sync\Endpoints\Endpoint; @@ -42,7 +43,7 @@ class Registry { * There can be multiple registries, reference them by namepsace. * For example "jetpack_boost". * - * @param $namespace string The namespace for this registry instance. + * @param string $namespace The namespace for this registry instance. */ public function __construct( $namespace ) { $this->namespace = $namespace; @@ -51,7 +52,7 @@ public function __construct( $namespace ) { /** * Sanitize a key. * - * @param $key string - Keys should only include alphanumeric characters and underscores. + * @param string $key - Keys should only include alphanumeric characters and underscores. * * @return string * @throws \Exception In debug mode, if the key is invalid. @@ -71,7 +72,7 @@ private function sanitize_key( $key ) { /** * Sanitize a key for use in a URL. * - * @param $key - Keys should only include alphanumeric characters and underscores. + * @param string $key - Keys should only include alphanumeric characters and underscores. * * @return string */ @@ -82,8 +83,8 @@ private function sanitize_url_key( $key ) { /** * Register a new entry and add it to the registry. * - * @param $key string - The name of the entry. For example `widget_status`. - * @param $entry Data_Sync_Entry + * @param string $key - The name of the entry. For example `widget_status`. + * @param Data_Sync_Entry $entry * * @return Data_Sync_Entry */ @@ -103,10 +104,10 @@ public function register( $key, $entry ) { /** * Register an action endpoint. * - * @param string $key The base key for the endpoint. - * @param string $action_name The name of the action. - * @param Schema $request_schema The schema for the action's request body. - * @param mixed $action_class The class handling the action logic. + * @param string $key The base key for the endpoint. + * @param string $action_name The name of the action. + * @param Schema_Parser $request_schema The schema for the action's request body. + * @param mixed $action_class The class handling the action logic. */ public function register_action( $key, $action_name, $request_schema, $action_class ) { // Create and store the action endpoint instance @@ -167,7 +168,7 @@ public function all() { /** * Get the endpoint for a given key. * - * @param $key string - The key for the endpoint. + * @param string $key - The key for the endpoint. * * @return Endpoint|false */ @@ -181,7 +182,7 @@ public function get_endpoint( $key ) { /** * Get the entry for a given key. * - * @param $key string - The key for the entry. + * @param string $key - The key for the entry. * * @return Data_Sync_Entry|false */ diff --git a/projects/packages/wp-js-data-sync/src/endpoints/class-action-endpoint.php b/projects/packages/wp-js-data-sync/src/endpoints/class-action-endpoint.php index a73752224c8cf..0d33274fd817a 100644 --- a/projects/packages/wp-js-data-sync/src/endpoints/class-action-endpoint.php +++ b/projects/packages/wp-js-data-sync/src/endpoints/class-action-endpoint.php @@ -41,11 +41,11 @@ class Action_Endpoint { /** * This class handles endpoints for DataSync actions. * - * @param $namespace - * @param $key - * @param $action_name - * @param $request_schema - * @param $action_class + * @param string $namespace + * @param string $key + * @param string $action_name + * @param Schema_Parser $request_schema + * @param Data_Sync_Action $action_class */ public function __construct( $namespace, $key, $action_name, $request_schema, $action_class ) { $this->action_class = $action_class; diff --git a/projects/plugins/crm/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x b/projects/plugins/crm/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x new file mode 100644 index 0000000000000..5ab42f8a0abd8 --- /dev/null +++ b/projects/plugins/crm/changelog/renovate-mediawiki-mediawiki-codesniffer-44.x @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed +Comment: Fix missing types in phpdoc comments. + diff --git a/projects/plugins/crm/tests/codeception/_support/Helper/JPCRM_Acceptance.php b/projects/plugins/crm/tests/codeception/_support/Helper/JPCRM_Acceptance.php index 2fe7e1e9e8dbb..ac25c67e9744b 100644 --- a/projects/plugins/crm/tests/codeception/_support/Helper/JPCRM_Acceptance.php +++ b/projects/plugins/crm/tests/codeception/_support/Helper/JPCRM_Acceptance.php @@ -249,7 +249,7 @@ public function getDatabase() { /** * Get the JetpackCRM table name * - * @param $name + * @param string $name * @return string */ public function table( $name ) { @@ -265,8 +265,8 @@ public function pdo() { /** * Load a page from it's core slug * - * @param $page_slug - * @param string $query + * @param string $page_slug + * @param string $query */ public function goToPageViaSlug( $page_slug, $query = '' ) { $this->amOnAdminPage( 'admin.php?page=' . $this->slugs[ $page_slug ] . $query ); diff --git a/projects/plugins/crm/tests/codeception/_support/Helper/RunProcess.php b/projects/plugins/crm/tests/codeception/_support/Helper/RunProcess.php index 10faae3a8c750..cd202b1c8d8e2 100644 --- a/projects/plugins/crm/tests/codeception/_support/Helper/RunProcess.php +++ b/projects/plugins/crm/tests/codeception/_support/Helper/RunProcess.php @@ -15,9 +15,9 @@ class RunProcess { /** * RunProcess constructor. * - * @param $cmd - * @param string $outputFile - * @param bool $append + * @param string|null $cmd + * @param string $outputFile + * @param bool $append */ public function __construct( $cmd, $outputFile = '/dev/null', $append = false ) { $this->cmd = $cmd;