From 83ddd30fe644168d59be0f958574ea88b17c18a8 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:20:58 +0000 Subject: [PATCH 01/44] Enforce consistent indentation --- eslint/.eslintrc-magento | 1 + eslint/rules/utils.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..0ae1f657 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -18,6 +18,7 @@ "eol-last": 2, "eqeqeq": [2, "smart"], "guard-for-in": 2, + "indent": [2, 4], "keyword-spacing": [2, {}], "lines-around-comment": [ 2, diff --git a/eslint/rules/utils.js b/eslint/rules/utils.js index ae181210..398e2b86 100644 --- a/eslint/rules/utils.js +++ b/eslint/rules/utils.js @@ -75,18 +75,18 @@ function getExpressionId(node) { while (node) { switch (node.type) { - case 'CallExpression': - node = node.callee; - break; - - case 'MemberExpression': - node = node.object; - break; - - case 'Identifier': - return node; - default: - return null; + case 'CallExpression': + node = node.callee; + break; + + case 'MemberExpression': + node = node.object; + break; + + case 'Identifier': + return node; + default: + return null; } } } From 0f1c1f195aa12117e80b7e9026338ce4528ea19e Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:27:50 +0000 Subject: [PATCH 02/44] Forbid overriding built-in objects --- eslint/.eslintrc-magento | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..f84ff61c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -50,6 +50,7 @@ "no-fallthrough": 2, "no-floating-decimal": 2, "no-func-assign": 2, + "no-global-assign": 2, "no-implied-eval": 2, "no-inner-declarations": 2, "no-invalid-regexp": 2, From 241f932a0324776cee6f451a9dbd8b3ba1064152 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:37:45 +0000 Subject: [PATCH 03/44] Disallow useless constructs --- eslint/.eslintrc-magento | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..7283333c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -81,6 +81,12 @@ } ], "no-use-before-define": 2, + "no-useless-call": 2, + "no-useless-computed-key": 2, + "no-useless-constructor": 2, + "no-useless-escape": 2, + "no-useless-rename": 2, + "no-useless-return": 2, "no-with": 2, "one-var": [2, "always"], "operator-assignment": [2, "always"], From 784a702a0923366be28ed62f1d2feb2efc27ae98 Mon Sep 17 00:00:00 2001 From: Kiel Pykett Date: Tue, 25 Jan 2022 10:18:06 +0000 Subject: [PATCH 04/44] Allow Template Literals --- eslint/.eslintrc-magento | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 5d403da3..a25fcf5c 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -84,7 +84,7 @@ "no-with": 2, "one-var": [2, "always"], "operator-assignment": [2, "always"], - "quotes": [2, "single"], + "quotes": [2, "single", {"allowTemplateLiterals": true}], "radix": 2, "semi": [2, "always"], "semi-spacing": 2, From 21db43236599f62bc161b1fdb35c7daa9559acac Mon Sep 17 00:00:00 2001 From: Aad Mathijssen Date: Fri, 4 Mar 2022 20:27:46 +0100 Subject: [PATCH 05/44] Add semicolon as statement separator in the special annotation check of the `Magento2.Security.XssTemplate` sniff --- Magento2/Sniffs/Security/XssTemplateSniff.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Security/XssTemplateSniff.php b/Magento2/Sniffs/Security/XssTemplateSniff.php index 3b4385e8..c7067d20 100644 --- a/Magento2/Sniffs/Security/XssTemplateSniff.php +++ b/Magento2/Sniffs/Security/XssTemplateSniff.php @@ -146,11 +146,11 @@ public function process(File $phpcsFile, $stackPtr) private function findSpecialAnnotation($stackPtr) { if ($this->tokens[$stackPtr]['code'] === T_ECHO) { - $startOfStatement = $this->file->findPrevious(T_OPEN_TAG, $stackPtr); + $startOfStatement = $this->file->findPrevious([T_OPEN_TAG, T_SEMICOLON], $stackPtr); return $this->file->findPrevious(T_COMMENT, $stackPtr, $startOfStatement); } if ($this->tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) { - $endOfStatement = $this->file->findNext(T_CLOSE_TAG, $stackPtr); + $endOfStatement = $this->file->findNext([T_CLOSE_TAG, T_SEMICOLON], $stackPtr); return $this->file->findNext(T_COMMENT, $stackPtr, $endOfStatement); } return false; From b67b07208b818aa9c3ab74104b1e5454241779a9 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Wed, 13 Jul 2022 11:08:52 +0100 Subject: [PATCH 06/44] Include all Magento2 sniffs in Magento2Framework --- Magento2Framework/ruleset.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Magento2Framework/ruleset.xml b/Magento2Framework/ruleset.xml index 5e16e7a1..5c4eef70 100644 --- a/Magento2Framework/ruleset.xml +++ b/Magento2Framework/ruleset.xml @@ -4,6 +4,8 @@ + + 5 warning From 5936239050ddb99f5aea5c9ab655efbc1e6c2c35 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 26 Jan 2023 11:51:03 +0000 Subject: [PATCH 07/44] Automatically remove useless comments When issues are detected and classified as Magento2.Commenting.ClassAndInterfacePHPDocFormatting.ForbiddenTags or Magento2.Commenting.ClassAndInterfacePHPDocFormatting.InvalidDescription, these can be fixed by removing the offending comment. --- ...ClassAndInterfacePHPDocFormattingSniff.php | 42 ++++- ...AndInterfacePHPDocFormattingUnitTest.1.inc | 7 + ...erfacePHPDocFormattingUnitTest.1.inc.fixed | 166 ++++++++++++++++++ ...AndInterfacePHPDocFormattingUnitTest.2.inc | 17 ++ ...erfacePHPDocFormattingUnitTest.2.inc.fixed | 166 ++++++++++++++++++ ...ssAndInterfacePHPDocFormattingUnitTest.php | 3 +- 6 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed create mode 100644 Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc.fixed diff --git a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php index 2d715c50..fec9f396 100644 --- a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php @@ -62,8 +62,10 @@ public function process(File $phpcsFile, $stackPtr) return; } + $commentCloserPtr = $tokens[$commentStartPtr]['comment_closer']; + if ($this->PHPDocFormattingValidator->providesMeaning($namePtr, $commentStartPtr, $tokens) !== true) { - $phpcsFile->addWarning( + $fix = $phpcsFile->addFixableWarning( sprintf( '%s description must contain meaningful information beyond what its name provides or be removed.', ucfirst($tokens[$stackPtr]['content']) @@ -71,6 +73,18 @@ public function process(File $phpcsFile, $stackPtr) $stackPtr, 'InvalidDescription' ); + + if ($fix) { + for ($i = $commentStartPtr; $i <= $commentCloserPtr; $i++) { + $phpcsFile->fixer->replaceToken($i, ''); + } + + if ($tokens[$commentStartPtr - 1]['code'] === T_WHITESPACE + && $tokens[$commentCloserPtr + 1]['code'] === T_WHITESPACE + ) { + $phpcsFile->fixer->replaceToken($commentCloserPtr + 1, ''); + } + } } if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) { @@ -104,11 +118,35 @@ private function validateTags(File $phpcsFile, $commentStartPtr, $tokens) } if (in_array($tokens[$i]['content'], $this->forbiddenTags) === true) { - $phpcsFile->addWarning( + $fix = $phpcsFile->addFixableWarning( sprintf('Tag %s MUST NOT be used.', $tokens[$i]['content']), $i, 'ForbiddenTags' ); + + if ($fix) { + for ($j = $i - 1; $j > $commentStartPtr; $j--) { + if (!in_array($tokens[$j]['code'], [T_DOC_COMMENT_STAR, T_DOC_COMMENT_WHITESPACE], true)) { + break; + } + + if ($tokens[$j]['code'] === T_DOC_COMMENT_WHITESPACE && $tokens[$j]['content'] === "\n") { + break; + } + + $phpcsFile->fixer->replaceToken($j, ''); + } + + $phpcsFile->fixer->replaceToken($i, ''); + + for ($j = $i + 1; $j < $commentCloserPtr; $j++) { + $phpcsFile->fixer->replaceToken($j, ''); + + if ($tokens[$j]['code'] === T_DOC_COMMENT_WHITESPACE && $tokens[$j]['content'] === "\n") { + break; + } + } + } } } diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index afd4c934..a17e80c8 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -179,3 +179,10 @@ class AlsoDeprecatedButHandler } +/** + * @package this tag should not be used + */ +class OnlyUselessCommentContent +{ + +} diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed new file mode 100644 index 00000000..6be0195c --- /dev/null +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc.fixed @@ -0,0 +1,166 @@ + 1, 109 => 1, 118 => 1, - 127 => 1 + 127 => 1, + 183 => 1, ]; } } From 18a457925b43c41bd9020b33d53dd381e2e74037 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 14 Feb 2023 20:02:11 +0000 Subject: [PATCH 08/44] Ensure only the relevant docblock is read --- .../Sniffs/Annotation/MethodAnnotationStructureSniff.php | 3 ++- .../Annotation/MethodAnnotationStructureUnitTest.inc | 8 ++++++++ .../Annotation/MethodAnnotationStructureUnitTest.php | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index 538f80c9..d6f7ca3c 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -53,7 +53,8 @@ public function process(File $phpcsFile, $stackPtr) $tokens = $phpcsFile->getTokens(); $commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0); $commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0); - if (!$commentStartPtr) { + $prevSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, $stackPtr, $commentEndPtr); + if (!$commentStartPtr || $prevSemicolon) { $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); return; } diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 2e0fdf0e..6402dad8 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -389,4 +389,12 @@ class MethodAnnotationFixture { return false; } + + /** @var OutputInterface */ + private $output; + + private function thisMethodHasNoDocBlock(): bool + { + return false; + } } diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php index b4c80141..9494e2d1 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.php @@ -31,13 +31,15 @@ public function getErrorList() 185 => 1, 227 => 1, 235 => 1, + 261 => 1, 268 => 2, 269 => 1, 277 => 1, 278 => 1, 288 => 1, 289 => 1, - 298 => 1 + 298 => 1, + 396 => 1, ]; } From ed981cff04b257f9e8c265b63fc76cad4f386a86 Mon Sep 17 00:00:00 2001 From: Kiel Pykett Date: Sat, 15 Apr 2023 01:34:46 +0100 Subject: [PATCH 09/44] Make Unescaped Output Error With Severity 10 --- Magento2/ruleset.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index ee171871..81ff0d8d 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -94,6 +94,10 @@ 10 error + + 10 + error + 10 error From 350cf9a1c81db7f4b6b1065e330273e014140577 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 16 May 2023 10:38:06 +0100 Subject: [PATCH 10/44] Add suggested replacement for \posix_isatty() --- Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php index 51730217..45e00eb7 100644 --- a/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php +++ b/Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php @@ -104,6 +104,7 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff '^parsekit_compile_string$' => null, '^pathinfo$' => 'Magento\Framework\Filesystem\Io\File::getPathInfo', '^pcntl_.*$' => null, + '^posix_isatty$' => 'stream_isatty', '^posix_.*$' => null, '^pfpro_.*$' => null, '^pfsockopen$' => null, From cf43987202e6f3cf9ecd7dc933296eaa97a9ed41 Mon Sep 17 00:00:00 2001 From: Sandip Chandela <49310430+sandipklevu@users.noreply.github.com> Date: Wed, 24 May 2023 11:57:37 +0530 Subject: [PATCH 11/44] allow readonly between phpdoc and property name --- .../Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php index 3732e2ac..0913be26 100644 --- a/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php @@ -32,6 +32,7 @@ class ClassPropertyPHPDocFormattingSniff extends AbstractVariableSniff T_NULLABLE, T_BITWISE_AND, T_TYPE_UNION, + T_READONLY, ]; /** From 8d37ab7b8eb9c204abf2adcb2e637065595021c5 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 28 May 2023 18:32:02 +0100 Subject: [PATCH 12/44] Update supported PHP versions --- .github/workflows/php.yml | 6 +----- Magento2/ruleset.xml | 4 ++-- composer.json | 2 +- composer.lock | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ac9fc0a0..52b6a97f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,15 +13,11 @@ jobs: fail-fast: false matrix: php-version: - - "7.4" - - "8.0" - "8.1" + - "8.2" dependencies: - "lowest" - "highest" - exclude: - - php-version: "8.1" - dependencies: "lowest" name: Tests with PHP ${{ matrix.php-version }} and ${{ matrix.dependencies }} dependencies steps: diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index 6234fb1b..4ff483e4 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -350,7 +350,7 @@ 8 warning - + 7 @@ -762,7 +762,7 @@ - + diff --git a/composer.json b/composer.json index c3fed220..bca16d28 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "type": "phpcodesniffer-standard", "version": "31", "require": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 56d67192..8c9becb7 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": "9ddd67b442b71fc7f10119eac7e40140", + "content-hash": "d941f20e7ac60684443f46eca9c86f5d", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2377,7 +2377,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "ext-simplexml": "*", "ext-dom": "*" }, From 053efe7414788b71ed3e8310dd020f757bfba297 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Mon, 29 May 2023 12:17:52 +0100 Subject: [PATCH 13/44] Increase minimum version of PHPUnit to fix tests --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index bca16d28..6b493d7a 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "phpcsstandards/phpcsutils": "~1.0.5" }, "require-dev": { - "phpunit/phpunit": "^9.5.8", + "phpunit/phpunit": "^9.5.10", "yoast/phpunit-polyfills": "^1.0" }, "autoload-dev": { diff --git a/composer.lock b/composer.lock index 8c9becb7..b778b3da 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": "d941f20e7ac60684443f46eca9c86f5d", + "content-hash": "93c2fcc45c74921ed7ed7b99da7505fa", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", From 889b4d21076d2ddef54d948c63688770a6449310 Mon Sep 17 00:00:00 2001 From: sandip Date: Mon, 12 Jun 2023 15:42:27 +0530 Subject: [PATCH 14/44] Add test case for readonly property --- .../ClassPropertyPHPDocFormattingUnitTest.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc index cde71269..aca8a73b 100644 --- a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc +++ b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc @@ -200,4 +200,14 @@ class correctlyFormattedClassMemberDocBlock * @deprecated This property will be removed in version 1.0.0 without replacement */ protected string $deprecatedWithKeyword; + + /** + * @var string + */ + protected readonly string $readOnlyString; + + /** + * @var int + */ + protected readonly int $readOnlyInteger; } From 7b6bd743937183d00390a9fdd9d3fa7af389ac30 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 6 Jul 2023 14:48:29 +0100 Subject: [PATCH 15/44] Add sniff for deprecated use of $block->escape... --- .../Legacy/EscapeMethodsOnBlockClassSniff.php | 100 ++++++++++++++++++ .../EscapeMethodsOnBlockClassUnitTest.inc | 87 +++++++++++++++ ...scapeMethodsOnBlockClassUnitTest.inc.fixed | 87 +++++++++++++++ .../EscapeMethodsOnBlockClassUnitTest.php | 45 ++++++++ 4 files changed, 319 insertions(+) create mode 100644 Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed create mode 100644 Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php diff --git a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php new file mode 100644 index 00000000..f44e3d0c --- /dev/null +++ b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php @@ -0,0 +1,100 @@ + true, + 'escapeHtml' => true, + 'escapeHtmlAttr' => true, + 'escapeJs' => true, + 'escapeJsQuote' => true, + 'escapeQuote' => true, + 'escapeUrl' => true, + 'escapeXssInUrl' => true, + ]; + + public function register() + { + return [ + T_OBJECT_OPERATOR, + ]; + } + + public function process(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if ($stackPtr <= 1 || !isset($tokens[$stackPtr + 2])) { + return; + } + + $objectPtr = $stackPtr - 1; + if ($tokens[$objectPtr]['code'] !== T_VARIABLE) { + $objectPtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, $objectPtr, null, true); + + if (!$objectPtr) { + return; + } + } + + if ($tokens[$objectPtr]['code'] !== T_VARIABLE + || $tokens[$objectPtr]['content'] !== '$block' + ) { + return; + } + + $methodPtr = $stackPtr + 1; + if ($tokens[$methodPtr]['code'] !== T_STRING) { + $methodPtr = $phpcsFile->findNext(Tokens::$emptyTokens, $methodPtr, null, true); + + if (!$methodPtr) { + return; + } + } + + if ($tokens[$methodPtr]['code'] !== T_STRING + || !isset(self::ESCAPER_METHODS[$tokens[$methodPtr]['content']]) + ) { + return; + } + + $openParenPtr = $methodPtr + 1; + if ($tokens[$openParenPtr]['code'] !== T_OPEN_PARENTHESIS) { + $openParenPtr = $phpcsFile->findNext(Tokens::$emptyTokens, $openParenPtr, null, true); + + if (!$openParenPtr) { + return; + } + } + + if ($tokens[$openParenPtr]['code'] !== T_OPEN_PARENTHESIS) { + return; + } + + $fix = $phpcsFile->addFixableWarning( + 'Using %s on $block is deprecated. Please use equivalent method on $escaper', + $methodPtr, + 'Found', + [ + $tokens[$methodPtr]['content'], // method name + ] + ); + + if ($fix) { + $phpcsFile->fixer->replaceToken($objectPtr, '$escaper'); + } + } +} diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc new file mode 100644 index 00000000..260f0c93 --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc @@ -0,0 +1,87 @@ + + +
+

This unescaped output is fine here; other sniffs will complain about it though.

+ + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> +
+ +
+

These should be using equivalent methods on the `$escaper` class, not the `$block` class.

+ + Note that I couldn't find any use of this method in any templates within Magento. + escapeCss($block->getSomeString()); ?> + + escapeHtml(__($block->getSomeString())) ?> + escapeHtml(__($block->getSomeString())); ?> + escapeHtml(__($block->getSomeString()), ['strong', 'em', 'span']) ?> + +
+
+
+ + + + The only example of this method being used was in a block class, rather than a template. + getItems() as $item) { + $item['sku'] = $block->escapeJsQuote($item['sku']); + } + ?> + + The only example of this method being used was in a block class, rather than a template. + escapeQuote(__($block->getData('welcome'))); ?> + + link text + + Note that I couldn't find any use of this method in any templates within Magento. + escapeXssInUrl($block->getSomeString()); ?> +
+ +
+

These are edge cases for formatting differences

+ + escapeHtml(''); + $block ->escapeHtml(''); + $block-> escapeHtml(''); + $block + ->escapeHtml(''); + $block + + ->escapeHtml(''); + $block-> + escapeHtml(''); + $block-> // comment + escapeHtml(''); + $block /* comment */ + ->escapeHtml(''); + + $block /* comment */ -> /* comment */ escapeHtml(''); + ?> +
+ +
+

These close-matches shouldn't be flagged by this sniff.

+ + escapeHTML(__($block->getSomeString())) ?> + escapeHtmlString(__($block->getSomeString())) ?> + escapeHtmlAttribute($block->getSomeString()) ?> + escapeCSS($block->getSomeString()); ?> + escapeJS($block->getData('html_id')) ?> + escapeJavaScript($block->getData('html_id')) ?> + escapeQuotes(__($block->getData('welcome'))); ?> + escapeURL($block->getUrl('adminhtml/notification/index')) ?> +
diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed new file mode 100644 index 00000000..80c4f22c --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.inc.fixed @@ -0,0 +1,87 @@ + + +
+

This unescaped output is fine here; other sniffs will complain about it though.

+ + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> + getSomeString(); ?> +
+ +
+

These should be using equivalent methods on the `$escaper` class, not the `$block` class.

+ + Note that I couldn't find any use of this method in any templates within Magento. + escapeCss($block->getSomeString()); ?> + + escapeHtml(__($block->getSomeString())) ?> + escapeHtml(__($block->getSomeString())); ?> + escapeHtml(__($block->getSomeString()), ['strong', 'em', 'span']) ?> + +
+
+
+ + + + The only example of this method being used was in a block class, rather than a template. + getItems() as $item) { + $item['sku'] = $escaper->escapeJsQuote($item['sku']); + } + ?> + + The only example of this method being used was in a block class, rather than a template. + escapeQuote(__($block->getData('welcome'))); ?> + + link text + + Note that I couldn't find any use of this method in any templates within Magento. + escapeXssInUrl($block->getSomeString()); ?> +
+ +
+

These are edge cases for formatting differences

+ + escapeHtml(''); + $escaper ->escapeHtml(''); + $escaper-> escapeHtml(''); + $escaper + ->escapeHtml(''); + $escaper + + ->escapeHtml(''); + $escaper-> + escapeHtml(''); + $escaper-> // comment + escapeHtml(''); + $escaper /* comment */ + ->escapeHtml(''); + + $escaper /* comment */ -> /* comment */ escapeHtml(''); + ?> +
+ +
+

These close-matches shouldn't be flagged by this sniff.

+ + escapeHTML(__($block->getSomeString())) ?> + escapeHtmlString(__($block->getSomeString())) ?> + escapeHtmlAttribute($block->getSomeString()) ?> + escapeCSS($block->getSomeString()); ?> + escapeJS($block->getData('html_id')) ?> + escapeJavaScript($block->getData('html_id')) ?> + escapeQuotes(__($block->getData('welcome'))); ?> + escapeURL($block->getUrl('adminhtml/notification/index')) ?> +
diff --git a/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php new file mode 100644 index 00000000..feead3d1 --- /dev/null +++ b/Magento2/Tests/Legacy/EscapeMethodsOnBlockClassUnitTest.php @@ -0,0 +1,45 @@ + 1, + 21 => 1, + 22 => 1, + 23 => 1, + 25 => 1, + 26 => 1, + 27 => 1, + 31 => 1, + 40 => 1, + 45 => 1, + 47 => 1, + 50 => 1, + 57 => 1, + 58 => 1, + 59 => 1, + 61 => 1, + 64 => 1, + 66 => 1, + 68 => 1, + 70 => 1, + 72 => 1, + ]; + } +} From b8acb6c61a735b9770470ea44cefbebf70139f69 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 6 Jul 2023 15:25:49 +0100 Subject: [PATCH 16/44] Add docblock to appease coding standard Note that these are useless, as it's the default behaviour to inherit from the parent docblock. --- Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php index f44e3d0c..4d6d8288 100644 --- a/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php +++ b/Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php @@ -26,6 +26,9 @@ class EscapeMethodsOnBlockClassSniff implements Sniff 'escapeXssInUrl' => true, ]; + /** + * @inheritDoc + */ public function register() { return [ @@ -33,6 +36,9 @@ public function register() ]; } + /** + * @inheritDoc + */ public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); From 0c945598626e0a9c4a9379f65e2547827f7a5544 Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Tue, 25 Jul 2023 13:32:36 +0530 Subject: [PATCH 17/44] AC-9184::Static Tests Failure on using Adobe copyright content - Added condition to use copyright in new format --- Magento2Framework/Sniffs/Header/CopyrightSniff.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Magento2Framework/Sniffs/Header/CopyrightSniff.php b/Magento2Framework/Sniffs/Header/CopyrightSniff.php index 81442207..e23aaba4 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightSniff.php @@ -16,6 +16,7 @@ class CopyrightSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; /** * @inheritdoc @@ -48,7 +49,9 @@ public function process(File $phpcsFile, $stackPtr) $content = $phpcsFile->getTokens()[$positionComment]['content']; $adobeCopyrightFound = preg_match(self::COPYRIGHT_ADOBE, $content); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || $adobeCopyrightFound) { + if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || + $adobeCopyrightFound || + strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { return; } From 5497f3f9f4b7c478ce6d1bef2f792ee16de33e4f Mon Sep 17 00:00:00 2001 From: Zach Stein Date: Wed, 26 Jul 2023 14:19:57 -0400 Subject: [PATCH 18/44] Update README.md Fixed a typo in readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cfd6c0a..8ca973e1 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ npm run eslint -- path/to/analyze ``` ### RECTOR PHP -From `magento-condign-standard` project, you can execute rector php as follows: +From `magento-coding-standard` project, you can execute rector php as follows: ```bash vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php ``` From 1aced4b2a1a380bb052607ab94f62c14dd8e6c5e Mon Sep 17 00:00:00 2001 From: Rimple Saini Date: Thu, 27 Jul 2023 17:14:01 +0530 Subject: [PATCH 19/44] AC-9184::Static Tests Failure on using Adobe copyright content - Update Version --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e4c0c17b..e3c79454 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "31", + "version": "32", "require": { "php": ">=7.4", "webonyx/graphql-php": "^15.0", diff --git a/composer.lock b/composer.lock index eb5742d8..993e2d97 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": "005e2882d6bfb6ebf35f0acfa890efac", + "content-hash": "527277cebca41c223661e203e2f5f5e7", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2382,5 +2382,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 7704854ed6b9c8bb29fa62a946e15ee8abcb434b Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Fri, 28 Jul 2023 11:50:24 +0530 Subject: [PATCH 20/44] AC-9184::Static Tests Failure on using Adobe copyright content - Added condition to use copyright in new format --- .../Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php | 2 ++ Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php index 3bafbb1f..3310e667 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php @@ -16,6 +16,7 @@ class CopyrightAnotherExtensionsFilesSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; /** * Defines the tokenizers that this sniff is using. @@ -48,6 +49,7 @@ public function process(File $phpcsFile, $stackPtr) if (strpos($fileText, self::COPYRIGHT_MAGENTO_TEXT) !== false || preg_match(self::COPYRIGHT_ADOBE, $fileText) + || strpos($fileText, self::COPYRIGHT_ADOBE_TEXT) !== false ) { return; } diff --git a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php index 1e488e69..5eae2b5e 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php @@ -16,6 +16,7 @@ class CopyrightGraphQLSniff implements Sniff private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; + private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; private const FILE_EXTENSION = 'graphqls'; @@ -44,7 +45,9 @@ public function process(File $phpcsFile, $stackPtr) // @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged $content = file_get_contents($phpcsFile->getFilename()); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || preg_match(self::COPYRIGHT_ADOBE, $content)) { + if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false + || preg_match(self::COPYRIGHT_ADOBE, $content) + || strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { return; } From 42f012962c566b552c43b12bb8f59e7c5ef798ee Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Mon, 14 Aug 2023 16:47:33 +0530 Subject: [PATCH 21/44] Resolve Conflict --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 993e2d97..4a94589d 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": "527277cebca41c223661e203e2f5f5e7", + "content-hash": "2cb0816434787b635536aa2fd6ac017f", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2377,10 +2377,10 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": "~8.1.0 || ~8.2.0", "ext-simplexml": "*", "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" -} + "plugin-api-version": "2.3.0" +} \ No newline at end of file From e52de693a38700c1a577c29af45527e9246bd2fa Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 15:55:37 +0530 Subject: [PATCH 22/44] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency --- composer.json | 2 +- composer.lock | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 04d1abc9..2d2c9974 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.15.10", + "rector/rector": "^0.18.0", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index 4a94589d..f63a6852 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": "2cb0816434787b635536aa2fd6ac017f", + "content-hash": "fecbeaf15a13fcb2776f3ac54efa39fb", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -222,16 +222,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.14", + "version": "1.10.30", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" + "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", - "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2910afdd3fe33e5afd71c09f3fb0d0845b48c410", + "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410", "shasum": "" }, "require": { @@ -260,8 +260,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.14" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -277,30 +280,29 @@ "type": "tidelift" } ], - "time": "2023-01-19T10:47:09+00:00" + "time": "2023-08-22T13:48:25+00:00" }, { "name": "rector/rector", - "version": "0.15.10", + "version": "0.18.0", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "000bfb6f7974449399f39e1a210458395b75c887" + "reference": "758ada29b5c80d933f906735d3026520390a2a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/000bfb6f7974449399f39e1a210458395b75c887", - "reference": "000bfb6f7974449399f39e1a210458395b75c887", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/758ada29b5c80d933f906735d3026520390a2a1d", + "reference": "758ada29b5c80d933f906735d3026520390a2a1d", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.7" + "phpstan/phpstan": "^1.10.26" }, "conflict": { "rector/rector-doctrine": "*", "rector/rector-downgrade-php": "*", - "rector/rector-php-parser": "*", "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, @@ -308,11 +310,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.14-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -323,9 +320,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.15.10" + "source": "https://github.com/rectorphp/rector/tree/0.18.0" }, "funding": [ { @@ -333,7 +336,7 @@ "type": "github" } ], - "time": "2023-01-21T14:30:16+00:00" + "time": "2023-08-17T12:53:22+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -2383,4 +2386,4 @@ }, "platform-dev": [], "plugin-api-version": "2.3.0" -} \ No newline at end of file +} From 5e4ef1363044093aaf7d54ce7cd98fac914b01aa Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 16:32:55 +0530 Subject: [PATCH 23/44] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency --- composer.json | 2 +- composer.lock | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 2d2c9974..54c62c61 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.18.0", + "rector/rector": "^0.16.0", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index f63a6852..833823d8 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": "fecbeaf15a13fcb2776f3ac54efa39fb", + "content-hash": "85706157c667b84ac6386062a90f04cb", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -284,21 +284,21 @@ }, { "name": "rector/rector", - "version": "0.18.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "758ada29b5c80d933f906735d3026520390a2a1d" + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/758ada29b5c80d933f906735d3026520390a2a1d", - "reference": "758ada29b5c80d933f906735d3026520390a2a1d", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.26" + "phpstan/phpstan": "^1.10.14" }, "conflict": { "rector/rector-doctrine": "*", @@ -310,6 +310,11 @@ "bin/rector" ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.15-dev" + } + }, "autoload": { "files": [ "bootstrap.php" @@ -328,7 +333,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.18.0" + "source": "https://github.com/rectorphp/rector/tree/0.16.0" }, "funding": [ { @@ -336,7 +341,7 @@ "type": "github" } ], - "time": "2023-08-17T12:53:22+00:00" + "time": "2023-05-05T12:12:17+00:00" }, { "name": "squizlabs/php_codesniffer", From a7257ac1e063dcab3cb27049046927a28c7aed5f Mon Sep 17 00:00:00 2001 From: Atul-glo35265 Date: Thu, 24 Aug 2023 16:59:28 +0530 Subject: [PATCH 24/44] AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency AC-9184::Static Tests Failure on using Adobe copyright content - Update Rector Dependency to latest version --- composer.json | 2 +- composer.lock | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 54c62c61..afee6829 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.16.0", + "rector/rector": "0.17.12", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index 833823d8..daf77a82 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": "85706157c667b84ac6386062a90f04cb", + "content-hash": "ed90b6398ecbe9407a63634ecf205431", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -284,21 +284,21 @@ }, { "name": "rector/rector", - "version": "0.16.0", + "version": "0.17.12", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f" + "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/2125ff71ea05b079562a8f59ca48a97eb78dc07f", - "reference": "2125ff71ea05b079562a8f59ca48a97eb78dc07f", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/af3a14a8a9fffa3100b730571c356f6c658d5e09", + "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.14" + "phpstan/phpstan": "^1.10.26" }, "conflict": { "rector/rector-doctrine": "*", @@ -310,11 +310,6 @@ "bin/rector" ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "0.15-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -333,7 +328,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.16.0" + "source": "https://github.com/rectorphp/rector/tree/0.17.12" }, "funding": [ { @@ -341,7 +336,7 @@ "type": "github" } ], - "time": "2023-05-05T12:12:17+00:00" + "time": "2023-08-10T15:22:02+00:00" }, { "name": "squizlabs/php_codesniffer", From cac60586a14e7420bc316acd9699b8dec575aaaf Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Fri, 15 Sep 2023 00:44:54 +0100 Subject: [PATCH 25/44] Allow more recent versions of rector --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index afee6829..3668d05d 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "0.17.12", + "rector/rector": "^0.17.12", "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, diff --git a/composer.lock b/composer.lock index daf77a82..dbe0c9be 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": "ed90b6398ecbe9407a63634ecf205431", + "content-hash": "2898da982b9bfa7d7caa896d1a5d8944", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2385,5 +2385,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 8f01c09f3da14785754495420718ce56cf89a4b6 Mon Sep 17 00:00:00 2001 From: Pieter Hoste Date: Wed, 20 Sep 2023 16:58:09 +0200 Subject: [PATCH 26/44] Removing dependency on symfony/polyfill, is no longer required now that we dropped support for PHP 7.4 --- composer.json | 1 - composer.lock | 119 +------------------------------------------------- 2 files changed, 1 insertion(+), 119 deletions(-) diff --git a/composer.json b/composer.json index 3668d05d..7fb04c15 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", - "symfony/polyfill": "^1.16", "phpcsstandards/phpcsutils": "^1.0.5" }, "require-dev": { diff --git a/composer.lock b/composer.lock index dbe0c9be..9ab29109 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": "2898da982b9bfa7d7caa896d1a5d8944", + "content-hash": "1a1a72f8272e9cd2cb0dd520a56aeea2", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -394,123 +394,6 @@ }, "time": "2022-06-18T07:21:10+00:00" }, - { - "name": "symfony/polyfill", - "version": "v1.27.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill.git", - "reference": "b78222a273aac3e5bab6358bf499d7f1fb88e48b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill/zipball/b78222a273aac3e5bab6358bf499d7f1fb88e48b", - "reference": "b78222a273aac3e5bab6358bf499d7f1fb88e48b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "replace": { - "symfony/polyfill-apcu": "self.version", - "symfony/polyfill-ctype": "self.version", - "symfony/polyfill-iconv": "self.version", - "symfony/polyfill-intl-grapheme": "self.version", - "symfony/polyfill-intl-icu": "self.version", - "symfony/polyfill-intl-idn": "self.version", - "symfony/polyfill-intl-messageformatter": "self.version", - "symfony/polyfill-intl-normalizer": "self.version", - "symfony/polyfill-mbstring": "self.version", - "symfony/polyfill-php72": "self.version", - "symfony/polyfill-php73": "self.version", - "symfony/polyfill-php74": "self.version", - "symfony/polyfill-php80": "self.version", - "symfony/polyfill-php81": "self.version", - "symfony/polyfill-php82": "self.version", - "symfony/polyfill-php83": "self.version", - "symfony/polyfill-util": "self.version", - "symfony/polyfill-uuid": "self.version", - "symfony/polyfill-xml": "self.version" - }, - "require-dev": { - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/phpunit-bridge": "^5.3|^6.0", - "symfony/var-dumper": "^4.4|^5.1|^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - } - }, - "autoload": { - "files": [ - "src/bootstrap.php", - "src/Apcu/bootstrap.php", - "src/Ctype/bootstrap.php", - "src/Uuid/bootstrap.php", - "src/Iconv/bootstrap.php", - "src/Intl/Grapheme/bootstrap.php", - "src/Intl/Idn/bootstrap.php", - "src/Intl/Icu/bootstrap.php", - "src/Intl/MessageFormatter/bootstrap.php", - "src/Intl/Normalizer/bootstrap.php", - "src/Mbstring/bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\": "src/" - }, - "classmap": [ - "src/Intl/Icu/Resources/stubs", - "src/Intl/MessageFormatter/Resources/stubs", - "src/Intl/Normalizer/Resources/stubs", - "src/Php82/Resources/stubs", - "src/Php80/Resources/stubs", - "src/Php73/Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfills backporting features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compat", - "compatibility", - "polyfill", - "shim" - ], - "support": { - "issues": "https://github.com/symfony/polyfill/issues", - "source": "https://github.com/symfony/polyfill/tree/v1.27.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-11-10T10:11:03+00:00" - }, { "name": "webonyx/graphql-php", "version": "v15.0.0", From 045be185b47acbc1fe077eb175c225de279d950f Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 11 Jan 2022 22:05:24 +0000 Subject: [PATCH 27/44] Enforce consistent spacing around keywords --- eslint/.eslintrc-magento | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/.eslintrc-magento b/eslint/.eslintrc-magento index 8ae28b85..e74a6f95 100644 --- a/eslint/.eslintrc-magento +++ b/eslint/.eslintrc-magento @@ -19,7 +19,7 @@ "eqeqeq": [2, "smart"], "guard-for-in": 2, "indent": [2, 4], - "keyword-spacing": [2, {}], + "keyword-spacing": [2, {"after": true, "before": true}], "lines-around-comment": [ 2, { From 6db538bfbfee7b2e03ae2e9c7342d182f85771d0 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 14 Nov 2023 19:15:34 +0530 Subject: [PATCH 28/44] AC-9670::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3 --- composer.json | 10 ++++-- composer.lock | 89 +++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 77 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index 7fb04c15..952f85c8 100644 --- a/composer.json +++ b/composer.json @@ -5,14 +5,20 @@ "OSL-3.0", "AFL-3.0" ], + "repositories": [ + { + "type" : "vcs", + "url" : "git@github.com:PHPCompatibility/PHPCompatibility.git" + } + ], "type": "phpcodesniffer-standard", "version": "32", "require": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", - "phpcompatibility/php-compatibility": "^9.3", + "phpcompatibility/php-compatibility": "dev-develop", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", "phpcsstandards/phpcsutils": "^1.0.5" diff --git a/composer.lock b/composer.lock index 9ab29109..f323f67c 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": "1a1a72f8272e9cd2cb0dd520a56aeea2", + "content-hash": "48f468df1de5e3e7239a0e87f1b63b00", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -86,47 +86,93 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "reference": "302dffedd8f1acfc0ed5c7ee096ea2237553ae1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/302dffedd8f1acfc0ed5c7ee096ea2237553ae1a", + "reference": "302dffedd8f1acfc0ed5c7ee096ea2237553ae1a", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.5", + "squizlabs/php_codesniffer": "^3.7.1" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "replace": { + "wimg/php-compatibility": "*" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.3", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.1.0", + "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.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." }, + "default-branch": true, "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev", + "dev-develop": "10.x-dev" + } + }, + "scripts": { + "test": [ + "@php ./vendor/phpunit/phpunit/phpunit --no-coverage" + ], + "test10": [ + "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist --no-coverage" + ], + "coverage": [ + "@php ./vendor/phpunit/phpunit/phpunit" + ], + "coverage10": [ + "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist" + ], + "coverage-local": [ + "@php ./vendor/phpunit/phpunit/phpunit --coverage-html ./build/logs" + ], + "coverage-local10": [ + "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist --coverage-html ./build/logs" + ], + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude .git" + ], + "check-complete": [ + "@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./PHPCompatibility" + ], + "check-complete-strict": [ + "@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./PHPCompatibility" + ], + "checkcs": [ + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" + ], + "fixcs": [ + "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" + ] + }, "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" + "role": "lead", + "homepage": "https://github.com/wimg" }, { "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "role": "lead", + "homepage": "https://github.com/jrfnl" }, { "name": "Contributors", @@ -138,13 +184,14 @@ "keywords": [ "compatibility", "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2023-09-13T12:40:15+00:00" }, { "name": "phpcsstandards/phpcsutils", @@ -2259,11 +2306,13 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "phpcompatibility/php-compatibility": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "ext-simplexml": "*", "ext-dom": "*" }, From 3b504d5faa56d31e053fabd6a6c1c7de1817791a Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 14 Nov 2023 19:19:56 +0530 Subject: [PATCH 29/44] AC-9670::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3 --- composer.json | 8 +---- composer.lock | 87 +++++++++++---------------------------------------- 2 files changed, 20 insertions(+), 75 deletions(-) diff --git a/composer.json b/composer.json index 952f85c8..2f1ebceb 100644 --- a/composer.json +++ b/composer.json @@ -5,12 +5,6 @@ "OSL-3.0", "AFL-3.0" ], - "repositories": [ - { - "type" : "vcs", - "url" : "git@github.com:PHPCompatibility/PHPCompatibility.git" - } - ], "type": "phpcodesniffer-standard", "version": "32", "require": { @@ -18,7 +12,7 @@ "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", - "phpcompatibility/php-compatibility": "dev-develop", + "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", "phpcsstandards/phpcsutils": "^1.0.5" diff --git a/composer.lock b/composer.lock index f323f67c..80e8f50e 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": "48f468df1de5e3e7239a0e87f1b63b00", + "content-hash": "cbdbbc742e102665104a6943ccca2481", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -86,93 +86,47 @@ }, { "name": "phpcompatibility/php-compatibility", - "version": "dev-develop", + "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "302dffedd8f1acfc0ed5c7ee096ea2237553ae1a" + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/302dffedd8f1acfc0ed5c7ee096ea2237553ae1a", - "reference": "302dffedd8f1acfc0ed5c7ee096ea2237553ae1a", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { - "php": ">=5.4", - "phpcsstandards/phpcsutils": "^1.0.5", - "squizlabs/php_codesniffer": "^3.7.1" + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, - "replace": { - "wimg/php-compatibility": "*" + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { - "php-parallel-lint/php-console-highlighter": "^1.0.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "phpcsstandards/phpcsdevcs": "^1.1.3", - "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.1.0", - "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0" + "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." }, - "default-branch": true, "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "9.x-dev", - "dev-develop": "10.x-dev" - } - }, - "scripts": { - "test": [ - "@php ./vendor/phpunit/phpunit/phpunit --no-coverage" - ], - "test10": [ - "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist --no-coverage" - ], - "coverage": [ - "@php ./vendor/phpunit/phpunit/phpunit" - ], - "coverage10": [ - "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist" - ], - "coverage-local": [ - "@php ./vendor/phpunit/phpunit/phpunit --coverage-html ./build/logs" - ], - "coverage-local10": [ - "@php ./vendor/phpunit/phpunit/phpunit -c phpunit10.xml.dist --coverage-html ./build/logs" - ], - "lint": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude .git" - ], - "check-complete": [ - "@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./PHPCompatibility" - ], - "check-complete-strict": [ - "@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./PHPCompatibility" - ], - "checkcs": [ - "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" - ], - "fixcs": [ - "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", - "role": "lead", - "homepage": "https://github.com/wimg" + "homepage": "https://github.com/wimg", + "role": "lead" }, { "name": "Juliette Reinders Folmer", - "role": "lead", - "homepage": "https://github.com/jrfnl" + "homepage": "https://github.com/jrfnl", + "role": "lead" }, { "name": "Contributors", @@ -184,14 +138,13 @@ "keywords": [ "compatibility", "phpcs", - "standards", - "static analysis" + "standards" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2023-09-13T12:40:15+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpcsstandards/phpcsutils", @@ -2306,9 +2259,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "phpcompatibility/php-compatibility": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { From 2a50cc7d2c671f3b1ad71b4b76faa50d4018a10f Mon Sep 17 00:00:00 2001 From: soumah Date: Thu, 30 Nov 2023 09:20:57 -0600 Subject: [PATCH 30/44] ACP2E-2635: Replace phpcompatibility/php-compatibility with magento/php-compatibility-fork * Fix fatal error in MethodAnnotationStructureSniff when there is no comment preceding a function or class method --- .github/workflows/php.yml | 2 +- .../MethodAnnotationStructureSniff.php | 27 ++++++++-- .../MethodAnnotationStructureUnitTest.inc | 54 ++++++++++++++++++- .../MethodAnnotationStructureUnitTest.php | 4 ++ Magento2/ruleset.xml | 2 +- composer.json | 10 ++-- composer.lock | 39 ++++++++------ 7 files changed, 110 insertions(+), 28 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 52b6a97f..9e9d024d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -89,4 +89,4 @@ jobs: run: composer install - name: Run rector - run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/phpcompatibility/php-compatibility/PHPCSAliases.php + run: vendor/bin/rector process Magento2 Magento2Framework PHP_CodeSniffer --dry-run --autoload-file vendor/squizlabs/php_codesniffer/autoload.php --autoload-file vendor/magento/php-compatibility-fork/PHPCSAliases.php diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index d6f7ca3c..f4250a17 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -51,14 +51,33 @@ public function register() public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $commentStartPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, ($stackPtr), 0); - $commentEndPtr = $phpcsFile->findPrevious(T_DOC_COMMENT_CLOSE_TAG, ($stackPtr), 0); - $prevSemicolon = $phpcsFile->findPrevious(T_SEMICOLON, $stackPtr, $commentEndPtr); - if (!$commentStartPtr || $prevSemicolon) { + $commentEndPtr = $stackPtr; + $tokensToFind = [ + \T_SEMICOLON, + \T_OPEN_CURLY_BRACKET, + \T_CLOSE_CURLY_BRACKET, + \T_ATTRIBUTE_END, + \T_DOC_COMMENT_CLOSE_TAG + ]; + + do { + $commentEndPtr = $phpcsFile->findPrevious($tokensToFind, $commentEndPtr - 1); + if ($commentEndPtr !== false + && $tokens[$commentEndPtr]['code'] === \T_ATTRIBUTE_END + && isset($tokens[$commentEndPtr]['attribute_opener']) + ) { + $commentEndPtr = $tokens[$commentEndPtr]['attribute_opener']; + } + } while ($commentEndPtr !== false && !in_array($tokens[$commentEndPtr]['code'], $tokensToFind, true)); + + if ($commentEndPtr === false || $tokens[$commentEndPtr]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); return; } + $commentStartPtr = $tokens[$commentEndPtr]['comment_opener'] + ?? $phpcsFile->findPrevious(T_DOC_COMMENT_OPEN_TAG, $commentEndPtr - 1); + if ($this->PHPDocFormattingValidator->hasDeprecatedWellFormatted($commentStartPtr, $tokens) !== true) { $phpcsFile->addWarning( 'Motivation behind the added @deprecated tag MUST be explained. ' diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 6402dad8..94512c01 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -1,5 +1,5 @@ 1, 10 => 1, 18 => 1, 30 => 1, @@ -40,6 +41,9 @@ public function getErrorList() 289 => 1, 298 => 1, 396 => 1, + 407 => 1, + 418 => 1, + 424 => 1, ]; } diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index e7ce2ee8..0090ed94 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -770,6 +770,6 @@ - +
diff --git a/composer.json b/composer.json index 7fb04c15..70878734 100644 --- a/composer.json +++ b/composer.json @@ -6,16 +6,16 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "32", + "version": "33", "require": { "php": "~8.1.0 || ~8.2.0", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", - "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", "rector/rector": "^0.17.12", - "phpcsstandards/phpcsutils": "^1.0.5" + "phpcsstandards/phpcsutils": "^1.0.5", + "magento/php-compatibility-fork": "^0.1" }, "require-dev": { "phpunit/phpunit": "^9.5.10", @@ -36,8 +36,8 @@ } }, "scripts": { - "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility", - "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../phpcompatibility/php-compatibility/PHPCompatibility" + "post-install-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility", + "post-update-cmd": "vendor/bin/phpcs --config-set installed_paths ../../..,../../magento/php-compatibility-fork/PHPCompatibility" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 9ab29109..9642857a 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": "1a1a72f8272e9cd2cb0dd520a56aeea2", + "content-hash": "e110c856856bed580d6d373c21e4b90e", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -85,31 +85,37 @@ "time": "2023-01-05T11:28:13+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "magento/php-compatibility-fork", + "version": "v0.1.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/magento/PHPCompatibilityFork.git", + "reference": "1cf031c2a68e3e52e460c5690ed8d1d6d45f4653" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/magento/PHPCompatibilityFork/zipball/1cf031c2a68e3e52e460c5690ed8d1d6d45f4653", + "reference": "1cf031c2a68e3e52e460c5690ed8d1d6d45f4653", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.0.5", + "squizlabs/php_codesniffer": "^3.7.1" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "replace": { + "phpcompatibility/php-compatibility": "*", + "wimg/php-compatibility": "*" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", + "phpcsstandards/phpcsdevcs": "^1.1.3", + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.1.0", + "yoast/phpunit-polyfills": "^1.0.5 || ^2.0.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", @@ -133,18 +139,19 @@ "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility. This is a fork of phpcompatibility/php-compatibility", "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, - "time": "2019-12-27T09:44:58+00:00" + "time": "2023-11-29T22:34:17+00:00" }, { "name": "phpcsstandards/phpcsutils", From a72c1665e06a864dd1092342b178f71e454af48e Mon Sep 17 00:00:00 2001 From: soumah Date: Mon, 4 Dec 2023 11:28:59 -0600 Subject: [PATCH 31/44] ACP2E-2674: [MCS] Fix duplicate "Comment block is missing" --- Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php | 2 +- Magento2/ruleset.xml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php index f4250a17..a76240c7 100644 --- a/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php +++ b/Magento2/Sniffs/Annotation/MethodAnnotationStructureSniff.php @@ -71,7 +71,7 @@ public function process(File $phpcsFile, $stackPtr) } while ($commentEndPtr !== false && !in_array($tokens[$commentEndPtr]['code'], $tokensToFind, true)); if ($commentEndPtr === false || $tokens[$commentEndPtr]['code'] !== \T_DOC_COMMENT_CLOSE_TAG) { - $phpcsFile->addError('Comment block is missing', $stackPtr, 'MethodArguments'); + $phpcsFile->addError('Comment block is missing', $stackPtr, 'NoCommentBlock'); return; } diff --git a/Magento2/ruleset.xml b/Magento2/ruleset.xml index 0090ed94..4ac058c0 100644 --- a/Magento2/ruleset.xml +++ b/Magento2/ruleset.xml @@ -758,6 +758,8 @@ */Test/* *Test.php */PHPCSUtils/* + +
From cf0c76178588aed68967d16f70c571b84e5a91cd Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Fri, 15 Dec 2023 14:51:13 +0530 Subject: [PATCH 32/44] AC-9670::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3 --- .github/workflows/php.yml | 1 + composer.json | 2 +- composer.lock | 20 +++++++++++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9e9d024d..3d907aa4 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,6 +15,7 @@ jobs: php-version: - "8.1" - "8.2" + - "8.3" dependencies: - "lowest" - "highest" diff --git a/composer.json b/composer.json index 36eabf64..d9e7e369 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "33", + "version": "34", "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "webonyx/graphql-php": "^15.0", diff --git a/composer.lock b/composer.lock index d7fdc84e..d2303da0 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": "e110c856856bed580d6d373c21e4b90e", + "content-hash": "92b77ce15a04f22e2c65643b97e96404", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -350,12 +350,12 @@ "version": "3.7.1", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, @@ -399,6 +399,20 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, + "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": "2022-06-18T07:21:10+00:00" }, { From 3b9314d19b3dd2409d411a906b15af70bf64da89 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 19 Dec 2023 22:36:13 +0530 Subject: [PATCH 33/44] AC-9670::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3 --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d9e7e369..36eabf64 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "34", + "version": "33", "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "webonyx/graphql-php": "^15.0", diff --git a/composer.lock b/composer.lock index d2303da0..93fc23da 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": "92b77ce15a04f22e2c65643b97e96404", + "content-hash": "2538347534e520207948a130ccd78862", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", From b16708662cd1aad3eb8983452c8f288c76b383e0 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 19 Dec 2023 22:42:14 +0530 Subject: [PATCH 34/44] AC-9670::Adobe Commerce 2.4.7 core code is compatible with PHP 8.3 --- composer.lock | 298 +++++++++++++++++++++++++++----------------------- 1 file changed, 164 insertions(+), 134 deletions(-) diff --git a/composer.lock b/composer.lock index 93fc23da..bac99425 100644 --- a/composer.lock +++ b/composer.lock @@ -155,30 +155,29 @@ }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.5", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656" + "reference": "908247bc65010c7b7541a9551e002db12e9dae70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/0cfef5193e68e8ff179333d8ae937db62939b656", - "reference": "0cfef5193e68e8ff179333d8ae937db62939b656", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", + "reference": "908247bc65010c7b7541a9551e002db12e9dae70", "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" + "squizlabs/php_codesniffer": "^3.8.0 || 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.3", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3", - "yoast/phpunit-polyfills": "^1.0.1" + "phpcsstandards/phpcsdevcs": "^1.1.6", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0" }, "type": "phpcodesniffer-standard", "extra": { @@ -223,22 +222,37 @@ "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" }, - "time": "2023-04-17T16:27:27+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-08T14:50:00+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.30", + "version": "1.10.50", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410" + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2910afdd3fe33e5afd71c09f3fb0d0845b48c410", - "reference": "2910afdd3fe33e5afd71c09f3fb0d0845b48c410", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", "shasum": "" }, "require": { @@ -287,20 +301,20 @@ "type": "tidelift" } ], - "time": "2023-08-22T13:48:25+00:00" + "time": "2023-12-13T10:59:42+00:00" }, { "name": "rector/rector", - "version": "0.17.12", + "version": "0.17.13", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09" + "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/af3a14a8a9fffa3100b730571c356f6c658d5e09", - "reference": "af3a14a8a9fffa3100b730571c356f6c658d5e09", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/e2003ba7c5bda06d7bb419cf4be8dae5f8672132", + "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132", "shasum": "" }, "require": { @@ -335,7 +349,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.12" + "source": "https://github.com/rectorphp/rector/tree/0.17.13" }, "funding": [ { @@ -343,20 +357,20 @@ "type": "github" } ], - "time": "2023-08-10T15:22:02+00:00" + "time": "2023-08-14T16:33:29+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", "shasum": "" }, "require": { @@ -366,7 +380,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/phpcs", @@ -385,19 +399,29 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/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" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, "funding": [ { @@ -413,20 +437,20 @@ "type": "open_collective" } ], - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-12-08T12:32:31+00:00" }, { "name": "webonyx/graphql-php", - "version": "v15.0.0", + "version": "v15.8.1", "source": { "type": "git", "url": "https://github.com/webonyx/graphql-php.git", - "reference": "dc754edf765479644a82d96105bd2979530d7f8d" + "reference": "575ac95f13adfb38219a748572355385c101fdf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/dc754edf765479644a82d96105bd2979530d7f8d", - "reference": "dc754edf765479644a82d96105bd2979530d7f8d", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/575ac95f13adfb38219a748572355385c101fdf7", + "reference": "575ac95f13adfb38219a748572355385c101fdf7", "shasum": "" }, "require": { @@ -436,24 +460,28 @@ }, "require-dev": { "amphp/amp": "^2.6", - "dms/phpunit-arraysubset-asserts": "^0.4", + "amphp/http-server": "^2.1", + "dms/phpunit-arraysubset-asserts": "dev-master", "ergebnis/composer-normalize": "^2.28", - "mll-lab/php-cs-fixer-config": "^4.4", + "friendsofphp/php-cs-fixer": "3.30.0", + "mll-lab/php-cs-fixer-config": "^5", "nyholm/psr7": "^1.5", "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "1.9.7", - "phpstan/phpstan-phpunit": "1.3.3", - "phpstan/phpstan-strict-rules": "1.4.4", - "phpunit/phpunit": "^9.5", - "psr/http-message": "^1", + "phpstan/phpstan": "1.10.47", + "phpstan/phpstan-phpunit": "1.3.15", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "^9.5 || ^10", + "psr/http-message": "^1 || ^2", "react/http": "^1.6", "react/promise": "^2.9", + "rector/rector": "^0.18", "symfony/polyfill-php81": "^1.23", - "symfony/var-exporter": "^5 || ^6", - "thecodingmachine/safe": "^1.3" + "symfony/var-exporter": "^5 || ^6 || ^7", + "thecodingmachine/safe": "^1.3 || ^2" }, "suggest": { + "amphp/http-server": "To leverage async resolving with webserver on AMPHP platform", "psr/http-message": "To use standard GraphQL server", "react/promise": "To leverage async resolving on React PHP platform" }, @@ -475,7 +503,7 @@ ], "support": { "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v15.0.0" + "source": "https://github.com/webonyx/graphql-php/tree/v15.8.1" }, "funding": [ { @@ -483,36 +511,36 @@ "type": "open_collective" } ], - "time": "2023-01-06T12:18:04+00:00" + "time": "2023-12-05T17:23:35+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.4.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9", + "doctrine/coding-standard": "^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.22" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -539,7 +567,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -555,20 +583,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T08:28:38+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -606,7 +634,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -614,20 +642,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.15.2", + "version": "v4.18.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", - "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1bcbb2179f97633e98bbbc87044ee2611c7d7999", + "reference": "1bcbb2179f97633e98bbbc87044ee2611c7d7999", "shasum": "" }, "require": { @@ -668,9 +696,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.18.0" }, - "time": "2022-11-12T15:38:23+00:00" + "time": "2023-12-10T21:03:43+00:00" }, { "name": "phar-io/manifest", @@ -785,23 +813,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.20", + "version": "9.2.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "af7463c955007de36db0c5e26d03e2f933c2e980" + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980", - "reference": "af7463c955007de36db0c5e26d03e2f933c2e980", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -816,8 +844,8 @@ "phpunit/phpunit": "^9.3" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "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": { @@ -850,7 +878,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" }, "funding": [ { @@ -858,7 +887,7 @@ "type": "github" } ], - "time": "2022-12-13T07:49:28+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1103,20 +1132,20 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.27", + "version": "9.6.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", - "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/05017b80304e0eb3f31d90194a563fd53a6021f1", + "reference": "05017b80304e0eb3f31d90194a563fd53a6021f1", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.3.1 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -1127,7 +1156,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-code-coverage": "^9.2.28", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -1145,8 +1174,8 @@ "sebastian/version": "^3.0.2" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "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" @@ -1154,7 +1183,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-master": "9.6-dev" } }, "autoload": { @@ -1185,7 +1214,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.15" }, "funding": [ { @@ -1201,7 +1231,7 @@ "type": "tidelift" } ], - "time": "2022-12-09T07:31:23+00:00" + "time": "2023-12-01T16:55:19+00:00" }, { "name": "sebastian/cli-parser", @@ -1503,16 +1533,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", "shasum": "" }, "require": { @@ -1557,7 +1587,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" }, "funding": [ { @@ -1565,20 +1595,20 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-07T05:35:17+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "5.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", "shasum": "" }, "require": { @@ -1620,7 +1650,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" }, "funding": [ { @@ -1628,7 +1658,7 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-02-03T06:03:51+00:00" }, { "name": "sebastian/exporter", @@ -1709,16 +1739,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -1761,7 +1791,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" }, "funding": [ { @@ -1769,7 +1799,7 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -1942,16 +1972,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", "shasum": "" }, "require": { @@ -1990,10 +2020,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "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.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, "funding": [ { @@ -2001,7 +2031,7 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2023-02-03T06:07:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2060,16 +2090,16 @@ }, { "name": "sebastian/type", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", - "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { @@ -2104,7 +2134,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" }, "funding": [ { @@ -2112,7 +2142,7 @@ "type": "github" } ], - "time": "2022-09-12T14:47:03+00:00" + "time": "2023-02-03T06:13:03+00:00" }, { "name": "sebastian/version", @@ -2169,16 +2199,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -2207,7 +2237,7 @@ "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.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -2215,20 +2245,20 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", + "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", "shasum": "" }, "require": { @@ -2275,7 +2305,7 @@ "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-03-30T23:39:05+00:00" + "time": "2023-08-19T14:25:08+00:00" } ], "aliases": [], From ac4d030a8e999b0a30bc1e98a5fffaecd0ea79fb Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Wed, 28 Feb 2024 14:51:24 +0530 Subject: [PATCH 35/44] AC-11385::Investigate phpstan/phpstan latest versions --- composer.json | 2 +- composer.lock | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 36eabf64..39afe8ee 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "ext-simplexml": "*", "ext-dom": "*", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.17.12", + "rector/rector": "^0.19.0", "phpcsstandards/phpcsutils": "^1.0.5", "magento/php-compatibility-fork": "^0.1" }, diff --git a/composer.lock b/composer.lock index bac99425..161bea71 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": "2538347534e520207948a130ccd78862", + "content-hash": "4dcee8d6315463cd4dbfdfdb9eb65cd2", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -243,16 +243,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.50", + "version": "1.10.59", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" + "reference": "e607609388d3a6d418a50a49f7940e8086798281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", - "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e607609388d3a6d418a50a49f7940e8086798281", + "reference": "e607609388d3a6d418a50a49f7940e8086798281", "shasum": "" }, "require": { @@ -301,25 +301,25 @@ "type": "tidelift" } ], - "time": "2023-12-13T10:59:42+00:00" + "time": "2024-02-20T13:59:13+00:00" }, { "name": "rector/rector", - "version": "0.17.13", + "version": "0.19.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132" + "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/e2003ba7c5bda06d7bb419cf4be8dae5f8672132", - "reference": "e2003ba7c5bda06d7bb419cf4be8dae5f8672132", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/de3b3bb159abd704b144aa86fb244f7f1f4ac947", + "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.26" + "phpstan/phpstan": "^1.10.56" }, "conflict": { "rector/rector-doctrine": "*", @@ -349,7 +349,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.17.13" + "source": "https://github.com/rectorphp/rector/tree/0.19.8" }, "funding": [ { @@ -357,7 +357,7 @@ "type": "github" } ], - "time": "2023-08-14T16:33:29+00:00" + "time": "2024-02-05T10:59:13+00:00" }, { "name": "squizlabs/php_codesniffer", From ae93ecf24574b84ee0f867909bebb45283936ddb Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Mon, 18 Mar 2024 18:18:10 +0530 Subject: [PATCH 36/44] Fixed tests after update the latest versions --- Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php | 2 +- Magento2/Rector/Src/ReplaceMbStrposNullLimit.php | 2 +- Magento2/Rector/Src/ReplaceNewDateTimeNull.php | 2 +- Magento2/Rector/Src/ReplacePregSplitNullLimit.php | 2 +- composer.json | 2 +- composer.lock | 2 +- rector.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php b/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php index a09fd34a..d7c38345 100644 --- a/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php +++ b/Magento2/Rector/Src/AddArrayAccessInterfaceReturnTypes.php @@ -9,7 +9,7 @@ use PhpParser\Node; use PhpParser\Node\Stmt\Class_; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php b/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php index 06ffaf25..06f04629 100644 --- a/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php +++ b/Magento2/Rector/Src/ReplaceMbStrposNullLimit.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Scalar\LNumber; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplaceNewDateTimeNull.php b/Magento2/Rector/Src/ReplaceNewDateTimeNull.php index 1bf54f0a..0ddabe51 100644 --- a/Magento2/Rector/Src/ReplaceNewDateTimeNull.php +++ b/Magento2/Rector/Src/ReplaceNewDateTimeNull.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\New_; use PhpParser\Node\Scalar\String_; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/Magento2/Rector/Src/ReplacePregSplitNullLimit.php b/Magento2/Rector/Src/ReplacePregSplitNullLimit.php index cc918eb4..b3f1d318 100644 --- a/Magento2/Rector/Src/ReplacePregSplitNullLimit.php +++ b/Magento2/Rector/Src/ReplacePregSplitNullLimit.php @@ -10,7 +10,7 @@ use PhpParser\Node; use PhpParser\Node\Expr\ConstFetch; use PhpParser\Node\Expr\FuncCall; -use Rector\Core\Rector\AbstractRector; +use Rector\Rector\AbstractRector; use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; diff --git a/composer.json b/composer.json index 39afe8ee..172e6b5b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "33", + "version": "34", "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "webonyx/graphql-php": "^15.0", diff --git a/composer.lock b/composer.lock index 161bea71..42089b48 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": "4dcee8d6315463cd4dbfdfdb9eb65cd2", + "content-hash": "82233b04ee4b5f65e33f6cc501ed3b4e", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", diff --git a/rector.php b/rector.php index 8bc53e56..bbb7a817 100644 --- a/rector.php +++ b/rector.php @@ -5,7 +5,7 @@ use Magento2\Rector\Src\ReplaceMbStrposNullLimit; use Magento2\Rector\Src\ReplaceNewDateTimeNull; use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; +use Rector\ValueObject\PhpVersion; use Rector\Php80\Rector\Class_\StringableForToStringRector; use Rector\Php80\Rector\ClassMethod\FinalPrivateToPrivateVisibilityRector; use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector; From df25dabc17e357e27508232eabcbb957b4a9bc53 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Mon, 18 Mar 2024 18:46:51 +0530 Subject: [PATCH 37/44] Fixed tests after update the latest versions --- rector.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rector.php b/rector.php index bbb7a817..9b240393 100644 --- a/rector.php +++ b/rector.php @@ -18,15 +18,15 @@ $rectorConfig->phpVersion(PhpVersion::PHP_81); // get services (needed for register a single rule) - $services = $rectorConfig->services(); +// $services = $rectorConfig->services(); // register a single rule - $services->set(FinalPrivateToPrivateVisibilityRector::class); - $services->set(OptionalParametersAfterRequiredRector::class); - $services->set(SetStateToStaticRector::class); - $services->set(StringableForToStringRector::class); - $services->set(Php81ResourceReturnToObjectRector::class); - $services->set(ReplacePregSplitNullLimit::class); - $services->set(ReplaceMbStrposNullLimit::class); - $services->set(ReplaceNewDateTimeNull::class); + $rectorConfig->singleton(FinalPrivateToPrivateVisibilityRector::class); + $rectorConfig->singleton(OptionalParametersAfterRequiredRector::class); + $rectorConfig->singleton(SetStateToStaticRector::class); + $rectorConfig->singleton(StringableForToStringRector::class); + $rectorConfig->singleton(Php81ResourceReturnToObjectRector::class); + $rectorConfig->singleton(ReplacePregSplitNullLimit::class); + $rectorConfig->singleton(ReplaceMbStrposNullLimit::class); + $rectorConfig->singleton(ReplaceNewDateTimeNull::class); }; From 88f7055304450c78099c6364089b57b13d92d27d Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Mon, 18 Mar 2024 19:07:28 +0530 Subject: [PATCH 38/44] Fixed tests after update the latest versions --- rector.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/rector.php b/rector.php index 9b240393..bd9da885 100644 --- a/rector.php +++ b/rector.php @@ -17,9 +17,6 @@ $rectorConfig->phpVersion(PhpVersion::PHP_80); $rectorConfig->phpVersion(PhpVersion::PHP_81); - // get services (needed for register a single rule) -// $services = $rectorConfig->services(); - // register a single rule $rectorConfig->singleton(FinalPrivateToPrivateVisibilityRector::class); $rectorConfig->singleton(OptionalParametersAfterRequiredRector::class); From 388a93852ec575f396f22a89c8e36b2667965f09 Mon Sep 17 00:00:00 2001 From: jayrangnani-gl <142883278+jayrangnani-gl@users.noreply.github.com> Date: Fri, 16 Aug 2024 19:05:35 +0530 Subject: [PATCH 39/44] AC-9098:Ability to use Adobe copyright for Adobe Commerce source code for Magento Open Source (CE)-Validation --- .../CopyrightAnotherExtensionsFilesSniff.php | 25 +++++--------- .../Sniffs/Header/CopyrightGraphQLSniff.php | 21 ++++-------- .../Sniffs/Header/CopyrightSniff.php | 30 +++++++---------- .../Sniffs/Header/CopyrightValidation.php | 33 +++++++++++++++++++ ...pyrightAnotherExtensionsFilesUnitTest.4.js | 4 +-- .../CopyrightGraphQLUnitTest.1.graphqls | 4 +-- .../CopyrightGraphQLUnitTest.2.graphqls | 2 +- .../Tests/Header/CopyrightGraphQLUnitTest.php | 18 +++++----- .../Tests/Header/CopyrightUnitTest.4.inc | 4 +-- .../Tests/Header/CopyrightUnitTest.php | 3 +- 10 files changed, 79 insertions(+), 65 deletions(-) create mode 100644 Magento2Framework/Sniffs/Header/CopyrightValidation.php diff --git a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php index 3310e667..bd4a1133 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php @@ -12,12 +12,9 @@ class CopyrightAnotherExtensionsFilesSniff implements Sniff { + use CopyrightValidation; private const WARNING_CODE = 'FoundCopyrightMissingOrWrongFormat'; - private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; - private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; - private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; - /** * Defines the tokenizers that this sniff is using. * @@ -45,19 +42,15 @@ public function process(File $phpcsFile, $stackPtr) return; } - $fileText = $phpcsFile->getTokensAsString($stackPtr, count($phpcsFile->getTokens())); + // @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged + $content = file_get_contents($phpcsFile->getFilename()); - if (strpos($fileText, self::COPYRIGHT_MAGENTO_TEXT) !== false - || preg_match(self::COPYRIGHT_ADOBE, $fileText) - || strpos($fileText, self::COPYRIGHT_ADOBE_TEXT) !== false - ) { - return; + if ($this->isCopyrightYearValid($content) === false) { + $phpcsFile->addWarningOnLine( + 'Copyright is missing or has wrong format', + null, + self::WARNING_CODE + ); } - - $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', - null, - self::WARNING_CODE - ); } } diff --git a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php index 5eae2b5e..e093d892 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php @@ -12,12 +12,9 @@ class CopyrightGraphQLSniff implements Sniff { + use CopyrightValidation; private const WARNING_CODE = 'FoundCopyrightMissingOrWrongFormat'; - private const COPYRIGHT_MAGENTO_TEXT = 'Copyright © Magento, Inc. All rights reserved.'; - private const COPYRIGHT_ADOBE = '/Copyright \d+ Adobe/'; - private const COPYRIGHT_ADOBE_TEXT = 'ADOBE CONFIDENTIAL'; - private const FILE_EXTENSION = 'graphqls'; /** @@ -45,16 +42,12 @@ public function process(File $phpcsFile, $stackPtr) // @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged $content = file_get_contents($phpcsFile->getFilename()); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false - || preg_match(self::COPYRIGHT_ADOBE, $content) - || strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { - return; + if ($this->isCopyrightYearValid($content) === false) { + $phpcsFile->addWarningOnLine( + 'Copyright is missing or has wrong format', + null, + self::WARNING_CODE + ); } - - $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', - null, - self::WARNING_CODE - ); } } diff --git a/Magento2Framework/Sniffs/Header/CopyrightSniff.php b/Magento2Framework/Sniffs/Header/CopyrightSniff.php index e23aaba4..151c01de 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightSniff.php @@ -1,7 +1,7 @@ getTokens()[$positionComment]['content']; - $adobeCopyrightFound = preg_match(self::COPYRIGHT_ADOBE, $content); + // @phpcs:ignore Magento2.Functions.DiscouragedFunction.Discouraged + $content = file_get_contents($phpcsFile->getFilename()); - if (strpos($content, self::COPYRIGHT_MAGENTO_TEXT) !== false || - $adobeCopyrightFound || - strpos($content, self::COPYRIGHT_ADOBE_TEXT) !== false) { - return; + if ($this->isCopyrightYearValid($content) === false) { + $phpcsFile->addWarningOnLine( + 'Copyright is missing or has wrong format', + null, + self::WARNING_CODE + ); } - - $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', - $phpcsFile->getTokens()[$positionComment]['line'], - self::WARNING_CODE - ); } } diff --git a/Magento2Framework/Sniffs/Header/CopyrightValidation.php b/Magento2Framework/Sniffs/Header/CopyrightValidation.php new file mode 100644 index 00000000..78ed5a26 --- /dev/null +++ b/Magento2Framework/Sniffs/Header/CopyrightValidation.php @@ -0,0 +1,33 @@ += 2010 && $year <= date("Y")) { + return true; + } else { + return false; + } + } else { + return false; + } + } +} diff --git a/Magento2Framework/Tests/Header/CopyrightAnotherExtensionsFilesUnitTest.4.js b/Magento2Framework/Tests/Header/CopyrightAnotherExtensionsFilesUnitTest.4.js index b47bf9d5..1027c04d 100644 --- a/Magento2Framework/Tests/Header/CopyrightAnotherExtensionsFilesUnitTest.4.js +++ b/Magento2Framework/Tests/Header/CopyrightAnotherExtensionsFilesUnitTest.4.js @@ -1,6 +1,6 @@ /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2021 Adobe + * All Rights Reserved. */ define([ diff --git a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.1.graphqls b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.1.graphqls index 6d212f25..29462f8c 100644 --- a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.1.graphqls +++ b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.1.graphqls @@ -1,5 +1,5 @@ -# Copyright © Magento, Inc. All rights reserved. -# See COPYING.txt for license details. +# Copyright 2021 Adobe +# All Rights Reserved. enum PriceAdjustmentCodesEnum { WEEE @deprecated(reason: "WEEE code is deprecated, use fixed_product_taxes.label") diff --git a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.2.graphqls b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.2.graphqls index 786f22ca..42e7b595 100644 --- a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.2.graphqls +++ b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.2.graphqls @@ -1,5 +1,5 @@ # Copyright 2020 Adobe -# See COPYING.txt for license details. +# All Rights Reserved. enum PriceAdjustmentCodesEnum { WEEE @deprecated(reason: "WEEE code is deprecated, use fixed_product_taxes.label") diff --git a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.php b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.php index 7323bd96..58fc7346 100644 --- a/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.php +++ b/Magento2Framework/Tests/Header/CopyrightGraphQLUnitTest.php @@ -9,28 +9,28 @@ class CopyrightGraphQLUnitTest extends AbstractGraphQLSniffUnitTestCase { - /** - * @inheritdoc - */ + /** + * @inheritdoc + */ public function getErrorList(): array { return []; } - /** - * @inheritdoc - */ + /** + * @inheritdoc + */ public function getWarningList($testFile = ''): array { if ($testFile === 'CopyrightGraphQLUnitTest.1.graphqls' || - $testFile === 'CopyrightGraphQLUnitTest.2.graphqls') { + $testFile === 'CopyrightGraphQLUnitTest.2.graphqls') { return []; } if ($testFile === 'CopyrightGraphQLUnitTest.3.graphqls' || - $testFile === 'CopyrightGraphQLUnitTest.4.graphqls') { + $testFile === 'CopyrightGraphQLUnitTest.4.graphqls') { return [ - null => 1 + null => 1 ]; } diff --git a/Magento2Framework/Tests/Header/CopyrightUnitTest.4.inc b/Magento2Framework/Tests/Header/CopyrightUnitTest.4.inc index 1cadcad0..e785253e 100644 --- a/Magento2Framework/Tests/Header/CopyrightUnitTest.4.inc +++ b/Magento2Framework/Tests/Header/CopyrightUnitTest.4.inc @@ -1,7 +1,7 @@ 1, ]; } + if ($testFile === 'CopyrightUnitTest.2.inc' || $testFile === 'CopyrightUnitTest.3.inc') { return [ - 3 => 1, + null => 1, ]; } From 98d3f1950ccab582611ddae7ea892349af082648 Mon Sep 17 00:00:00 2001 From: jayrangnani-gl <142883278+jayrangnani-gl@users.noreply.github.com> Date: Mon, 19 Aug 2024 18:00:18 +0530 Subject: [PATCH 40/44] AC-9098:Ability to use Adobe copyright for Adobe Commerce source code for Magento Open Source (CE)-Validatio --- Magento2/Helpers/Assert.php | 4 ++-- Magento2/Helpers/Commenting/PHPDocFormattingValidator.php | 4 ++-- Magento2/Helpers/Tokenizer/AbstractTokenizer.php | 4 ++-- Magento2/Helpers/Tokenizer/Parameter.php | 4 ++-- Magento2/Helpers/Tokenizer/Variable.php | 5 ++--- Magento2/Sniffs/Annotation/AnnotationFormatValidator.php | 4 ++-- .../Sniffs/Annotation/MethodAnnotationStructureSniff.php | 4 ++-- Magento2/Sniffs/Annotation/MethodArgumentsSniff.php | 4 ++-- Magento2/Sniffs/Classes/AbstractApiSniff.php | 4 ++-- Magento2/Sniffs/Classes/DiscouragedDependenciesSniff.php | 4 ++-- Magento2/Sniffs/CodeAnalysis/EmptyBlockSniff.php | 4 ++-- .../Commenting/ClassAndInterfacePHPDocFormattingSniff.php | 4 ++-- .../Commenting/ClassPropertyPHPDocFormattingSniff.php | 4 ++-- .../Sniffs/Commenting/ConstantsPHPDocFormattingSniff.php | 4 ++-- Magento2/Sniffs/Exceptions/DirectThrowSniff.php | 4 ++-- Magento2/Sniffs/Exceptions/ThrowCatchSniff.php | 5 ++--- .../Sniffs/Exceptions/TryProcessSystemResourcesSniff.php | 4 ++-- Magento2/Sniffs/Functions/DiscouragedFunctionSniff.php | 4 ++-- .../Functions/FunctionsDeprecatedWithoutArgumentSniff.php | 4 ++-- Magento2/Sniffs/Functions/StaticFunctionSniff.php | 4 ++-- Magento2/Sniffs/GraphQL/AbstractGraphQLSniff.php | 4 ++-- Magento2/Sniffs/GraphQL/ValidArgumentNameSniff.php | 5 ++--- Magento2/Sniffs/GraphQL/ValidEnumValueSniff.php | 5 ++--- Magento2/Sniffs/GraphQL/ValidFieldNameSniff.php | 4 ++-- Magento2/Sniffs/GraphQL/ValidTopLevelFieldNameSniff.php | 4 ++-- Magento2/Sniffs/GraphQL/ValidTypeNameSniff.php | 4 ++-- Magento2/Sniffs/Html/HtmlBindingSniff.php | 5 ++--- Magento2/Sniffs/Html/HtmlClosingVoidTagsSniff.php | 4 ++-- Magento2/Sniffs/Html/HtmlCollapsibleAttributeSniff.php | 5 ++--- Magento2/Sniffs/Html/HtmlDirectiveSniff.php | 5 ++--- Magento2/Sniffs/Html/HtmlSelfClosingTagsSniff.php | 5 ++--- Magento2/Sniffs/Legacy/AbstractBlockSniff.php | 4 ++-- .../Legacy/ClassReferencesInConfigurationFilesSniff.php | 4 ++-- Magento2/Sniffs/Legacy/DiConfigSniff.php | 5 ++--- Magento2/Sniffs/Legacy/EmailTemplateSniff.php | 5 ++--- Magento2/Sniffs/Legacy/EscapeMethodsOnBlockClassSniff.php | 5 ++--- Magento2/Sniffs/Legacy/InstallUpgradeSniff.php | 4 ++-- Magento2/Sniffs/Legacy/LayoutSniff.php | 4 ++-- Magento2/Sniffs/Legacy/MageEntitySniff.php | 4 ++-- Magento2/Sniffs/Legacy/ModuleXMLSniff.php | 5 ++--- Magento2/Sniffs/Legacy/ObsoleteAclSniff.php | 4 ++-- Magento2/Sniffs/Legacy/ObsoleteConfigNodesSniff.php | 5 ++--- Magento2/Sniffs/Legacy/ObsoleteConnectionSniff.php | 4 ++-- Magento2/Sniffs/Legacy/ObsoleteMenuSniff.php | 4 ++-- Magento2/Sniffs/Legacy/ObsoleteSystemConfigurationSniff.php | 5 ++--- Magento2/Sniffs/Legacy/PhtmlTemplateSniff.php | 4 ++-- Magento2/Sniffs/Legacy/RestrictedCodeSniff.php | 4 ++-- Magento2/Sniffs/Legacy/TableNameSniff.php | 4 ++-- Magento2/Sniffs/Legacy/WidgetXMLSniff.php | 5 ++--- Magento2/Sniffs/Legacy/_files/restricted_classes.php | 4 ++-- Magento2/Sniffs/Less/AvoidIdSniff.php | 4 ++-- Magento2/Sniffs/Less/BracesFormattingSniff.php | 4 ++-- Magento2/Sniffs/Less/ClassNamingSniff.php | 4 ++-- Magento2/Sniffs/Less/ColonSpacingSniff.php | 4 ++-- Magento2/Sniffs/Less/ColourDefinitionSniff.php | 4 ++-- Magento2/Sniffs/Less/CombinatorIndentationSniff.php | 4 ++-- Magento2/Sniffs/Less/CommentLevelsSniff.php | 4 ++-- Magento2/Sniffs/Less/ImportantPropertySniff.php | 4 ++-- Magento2/Sniffs/Less/IndentationSniff.php | 4 ++-- Magento2/Sniffs/Less/PropertiesLineBreakSniff.php | 4 ++-- Magento2/Sniffs/Less/PropertiesSortingSniff.php | 4 ++-- Magento2/Sniffs/Less/QuotesSniff.php | 4 ++-- Magento2/Sniffs/Less/SelectorDelimiterSniff.php | 4 ++-- Magento2/Sniffs/Less/SemicolonSpacingSniff.php | 4 ++-- Magento2/Sniffs/Less/TokenizerSymbolsInterface.php | 4 ++-- Magento2/Sniffs/Less/TypeSelectorConcatenationSniff.php | 4 ++-- Magento2/Sniffs/Less/TypeSelectorsSniff.php | 4 ++-- Magento2/Sniffs/Less/VariablesSniff.php | 4 ++-- Magento2/Sniffs/Less/ZeroUnitsSniff.php | 4 ++-- Magento2/Sniffs/Methods/DeprecatedModelMethodSniff.php | 4 ++-- .../Sniffs/Namespaces/ImportsFromTestNamespaceSniff.php | 4 ++-- Magento2/Sniffs/NamingConvention/InterfaceNameSniff.php | 4 ++-- Magento2/Sniffs/NamingConvention/ReservedWordsSniff.php | 4 ++-- Magento2/Sniffs/PHP/ArrayAutovivificationSniff.php | 4 ++-- .../Sniffs/PHP/AutogeneratedClassNotInConstructorSniff.php | 4 ++-- Magento2/Sniffs/PHP/FinalImplementationSniff.php | 4 ++-- Magento2/Sniffs/PHP/GotoSniff.php | 4 ++-- Magento2/Sniffs/PHP/LiteralNamespacesSniff.php | 4 ++-- Magento2/Sniffs/PHP/ReturnValueCheckSniff.php | 4 ++-- Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php | 4 ++-- Magento2/Sniffs/PHP/VarSniff.php | 4 ++-- Magento2/Sniffs/Performance/ForeachArrayMergeSniff.php | 4 ++-- Magento2/Sniffs/SQL/RawQuerySniff.php | 4 ++-- Magento2/Sniffs/Security/IncludeFileSniff.php | 4 ++-- Magento2/Sniffs/Security/InsecureFunctionSniff.php | 4 ++-- Magento2/Sniffs/Security/LanguageConstructSniff.php | 4 ++-- Magento2/Sniffs/Security/SuperglobalSniff.php | 4 ++-- Magento2/Sniffs/Security/XssTemplateSniff.php | 4 ++-- Magento2/Sniffs/Strings/ExecutableRegExSniff.php | 4 ++-- Magento2/Sniffs/Strings/StringConcatSniff.php | 4 ++-- Magento2/Sniffs/Templates/ThisInTemplateSniff.php | 4 ++-- Magento2/Sniffs/Translation/ConstantUsageSniff.php | 4 ++-- Magento2/Sniffs/Whitespace/MultipleEmptyLinesSniff.php | 4 ++-- .../Sniffs/Header/CopyrightAnotherExtensionsFilesSniff.php | 6 +++--- Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php | 6 +++--- Magento2Framework/Sniffs/Header/CopyrightSniff.php | 2 +- Magento2Framework/Sniffs/Header/LicenseSniff.php | 4 ++-- 97 files changed, 195 insertions(+), 210 deletions(-) diff --git a/Magento2/Helpers/Assert.php b/Magento2/Helpers/Assert.php index 9b3eb0dc..54bb3995 100644 --- a/Magento2/Helpers/Assert.php +++ b/Magento2/Helpers/Assert.php @@ -1,7 +1,7 @@ isCopyrightYearValid($content) === false) { $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', + 'Copyright is missing or Copyright content/year is not valid', null, self::WARNING_CODE ); diff --git a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php index e093d892..22e8615f 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightGraphQLSniff.php @@ -1,7 +1,7 @@ isCopyrightYearValid($content) === false) { $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', + 'Copyright is missing or Copyright content/year is not valid', null, self::WARNING_CODE ); diff --git a/Magento2Framework/Sniffs/Header/CopyrightSniff.php b/Magento2Framework/Sniffs/Header/CopyrightSniff.php index 151c01de..eef4d578 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightSniff.php +++ b/Magento2Framework/Sniffs/Header/CopyrightSniff.php @@ -49,7 +49,7 @@ public function process(File $phpcsFile, $stackPtr) if ($this->isCopyrightYearValid($content) === false) { $phpcsFile->addWarningOnLine( - 'Copyright is missing or has wrong format', + 'Copyright is missing or Copyright content/year is not valid', null, self::WARNING_CODE ); diff --git a/Magento2Framework/Sniffs/Header/LicenseSniff.php b/Magento2Framework/Sniffs/Header/LicenseSniff.php index cf7a5479..f5562421 100644 --- a/Magento2Framework/Sniffs/Header/LicenseSniff.php +++ b/Magento2Framework/Sniffs/Header/LicenseSniff.php @@ -1,7 +1,7 @@ Date: Wed, 21 Aug 2024 16:45:43 +0530 Subject: [PATCH 41/44] AC-9098:Ability to use Adobe copyright for Adobe Commerce source code for Magento Open Source (CE)-Validation --- Magento2Framework/Sniffs/Header/CopyrightValidation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Magento2Framework/Sniffs/Header/CopyrightValidation.php b/Magento2Framework/Sniffs/Header/CopyrightValidation.php index 78ed5a26..589e26aa 100644 --- a/Magento2Framework/Sniffs/Header/CopyrightValidation.php +++ b/Magento2Framework/Sniffs/Header/CopyrightValidation.php @@ -11,7 +11,7 @@ trait CopyrightValidation { /** - * Check is copyright year valid or not + * Check if copyright content/year valid or not * * @param string $content * @return bool From 33a79a65b626acba68a4ae9da584ec6ce230a5a8 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Fri, 6 Sep 2024 12:41:16 +0530 Subject: [PATCH 42/44] AC-12715::Investigate the laminas composer dependencies upgrading to latest version --- composer.json | 2 +- composer.lock | 33 ++++++++++++++++----------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 172e6b5b..300f8ddc 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "ext-simplexml": "*", "ext-dom": "*", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.19.0", + "rector/rector": "^1.2.4", "phpcsstandards/phpcsutils": "^1.0.5", "magento/php-compatibility-fork": "^0.1" }, diff --git a/composer.lock b/composer.lock index 42089b48..96395de9 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": "82233b04ee4b5f65e33f6cc501ed3b4e", + "content-hash": "05d8d7651a86d5880335013ba0dce696", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -243,16 +243,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.59", + "version": "1.12.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e607609388d3a6d418a50a49f7940e8086798281" + "reference": "0ca1c7bb55fca8fe6448f16fff0f311ccec960a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e607609388d3a6d418a50a49f7940e8086798281", - "reference": "e607609388d3a6d418a50a49f7940e8086798281", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0ca1c7bb55fca8fe6448f16fff0f311ccec960a1", + "reference": "0ca1c7bb55fca8fe6448f16fff0f311ccec960a1", "shasum": "" }, "require": { @@ -295,31 +295,27 @@ { "url": "https://github.com/phpstan", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2024-02-20T13:59:13+00:00" + "time": "2024-09-05T16:09:28+00:00" }, { "name": "rector/rector", - "version": "0.19.8", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947" + "reference": "42a4aa23b48b4cfc8ebfeac2b570364e27744381" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/de3b3bb159abd704b144aa86fb244f7f1f4ac947", - "reference": "de3b3bb159abd704b144aa86fb244f7f1f4ac947", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/42a4aa23b48b4cfc8ebfeac2b570364e27744381", + "reference": "42a4aa23b48b4cfc8ebfeac2b570364e27744381", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.56" + "phpstan/phpstan": "^1.11.11" }, "conflict": { "rector/rector-doctrine": "*", @@ -327,6 +323,9 @@ "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, "bin": [ "bin/rector" ], @@ -349,7 +348,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.19.8" + "source": "https://github.com/rectorphp/rector/tree/1.2.4" }, "funding": [ { @@ -357,7 +356,7 @@ "type": "github" } ], - "time": "2024-02-05T10:59:13+00:00" + "time": "2024-08-23T09:03:01+00:00" }, { "name": "squizlabs/php_codesniffer", From 345382c88a7d621c016dc59dd928d1526ee94a9e Mon Sep 17 00:00:00 2001 From: jayrangnani-gl <142883278+jayrangnani-gl@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:42:28 +0530 Subject: [PATCH 43/44] AC-9098:Ability to use Adobe copyright for Adobe Commerce source code Magento Open Source (CE)-version Changed --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 300f8ddc..c80111c5 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "34", + "version": "35", "require": { "php": "~8.1.0 || ~8.2.0 || ~8.3.0", "webonyx/graphql-php": "^15.0", From 00938f811fbb3a1878b73173243f28ec01a192d8 Mon Sep 17 00:00:00 2001 From: jayrangnani-gl <142883278+jayrangnani-gl@users.noreply.github.com> Date: Mon, 7 Oct 2024 12:47:05 +0530 Subject: [PATCH 44/44] AC-9098:Ability to use Adobe copyright for Adobe Commerce source code Magento Open Source (CE)-version Changed --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 96395de9..43e60b65 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": "05d8d7651a86d5880335013ba0dce696", + "content-hash": "e2b70ce9c22c7b443187cd24724bcf7d", "packages": [ { "name": "dealerdirect/phpcodesniffer-composer-installer",