From 557b1d99dbbdedd3e11587a0fdc8ad7901061126 Mon Sep 17 00:00:00 2001 From: Aad Mathijssen Date: Fri, 4 Mar 2022 19:54:37 +0100 Subject: [PATCH 01/27] Resolve incorrect violation code by resetting the hasDisallowedAnnotation property at then end of processing --- Magento2/Sniffs/Security/XssTemplateSniff.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Magento2/Sniffs/Security/XssTemplateSniff.php b/Magento2/Sniffs/Security/XssTemplateSniff.php index 3b4385e8..2ba8e8c0 100644 --- a/Magento2/Sniffs/Security/XssTemplateSniff.php +++ b/Magento2/Sniffs/Security/XssTemplateSniff.php @@ -135,6 +135,7 @@ public function process(File $phpcsFile, $stackPtr) $statement = array_shift($this->statements); $this->detectUnescapedString($statement); } + $this->hasDisallowedAnnotation = false; } /** From 7c702e0b668036273309fc6cd78f970c452d1999 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 5 Apr 2022 09:48:28 +0100 Subject: [PATCH 02/27] Add @author to forbidden tag list Ref https://devdocs.magento.com/guides/v2.4/coding-standards/docblock-standard-general.html#documentation-space --- .../Commenting/ClassAndInterfacePHPDocFormattingSniff.php | 1 + .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 2 +- .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc | 2 +- .../Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php index 2d715c50..20c12851 100644 --- a/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassAndInterfacePHPDocFormattingSniff.php @@ -24,6 +24,7 @@ class ClassAndInterfacePHPDocFormattingSniff implements Sniff * @var string[] List of tags that can not be used in comments */ public $forbiddenTags = [ + '@author', '@category', '@package', '@subpackage' diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e5895e32..e2727967 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -60,7 +60,7 @@ class EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is actually ok + * @author is not ment to be used * @category is irrelevant * @package is not ment to be used * @subpackage does not belong here diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index 96900de2..e45e15ff 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -60,7 +60,7 @@ interface EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is actually ok + * @author is not ment to be used * @category is irrelevant * @package is not ment to be used * @subpackage does not belong here diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php index 9b5b2f85..b6a1c206 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.php @@ -29,6 +29,7 @@ public function getWarningList($testFile = '') 35 => 1, 44 => 1, 52 => 1, + 63 => 1, 64 => 1, 65 => 1, 66 => 1, From 1f76b15da9af73ee88b41ad2ddedaa0f5ab29a8a Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Wed, 6 Jul 2022 15:51:56 +0100 Subject: [PATCH 03/27] Correct spelling/grammar --- .../ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 4 ++-- .../ClassAndInterfacePHPDocFormattingUnitTest.2.inc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e2727967..146cded2 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -60,9 +60,9 @@ class EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is not ment to be used + * @author should not be used * @category is irrelevant - * @package is not ment to be used + * @package should not be used * @subpackage does not belong here */ class ExampleHandler diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index e45e15ff..b6decf6c 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -60,9 +60,9 @@ interface EmptyHandler * @api is ok here * @deprecated can be used in this context * @see is ok here - * @author is not ment to be used + * @author should not be used * @category is irrelevant - * @package is not ment to be used + * @package should not be used * @subpackage does not belong here */ interface ExampleHandler From 2cf24b3b14db5d2f45d59c1ab4216313629d5d1d Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Wed, 31 Aug 2022 17:18:14 +0200 Subject: [PATCH 04/27] Implement changes approved to @see tag in Dev guild --- .../Commenting/PHPDocFormattingValidator.php | 7 ++++++- .../MethodAnnotationStructureUnitTest.inc | 20 +++++++++++++++++++ ...AndInterfacePHPDocFormattingUnitTest.1.inc | 17 ++++++++++++++++ ...AndInterfacePHPDocFormattingUnitTest.2.inc | 16 +++++++++++++++ .../ClassPropertyPHPDocFormattingUnitTest.inc | 6 ++++++ .../ConstantsPHPDocFormattingUnitTest.2.inc | 10 ++++++++++ 6 files changed, 75 insertions(+), 1 deletion(-) diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index 9fd42e7f..3421b8a1 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -13,6 +13,8 @@ */ class PHPDocFormattingValidator { + private const REMOVED_IN_VERSION = 'removed in version'; + /** * Finds matching PHPDoc for current pointer * @@ -123,7 +125,10 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - return false; + if (!stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0)) { + return false; + } + return true; } return $tokens[$seePtr + 2]['code'] === T_DOC_COMMENT_STRING; diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 4d3e0b7b..6b7431c9 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -369,4 +369,24 @@ class MethodAnnotationFixture { return true; } + + /** + * This deprecated function is correct even though it only contains the @deprecated tag. + * + * @deprecated It will be removed in version 1.0.0 + */ + public function correctBecauseOfKeywordPhrase() + { + return false; + } + + /** + * This deprecated function is correct even though it only contains the @deprecated tag. + * + * @deprecated WOW! It will be removed in version 1.0.0 + */ + public function alsoCorrectBecauseOfKeywordPhrase() + { + return false; + } } diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index e5895e32..c9785e18 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -162,3 +162,20 @@ class OldHandler { } + +/** + * @deprecated It will be removed in version 1.0.0 + */ +class DeprecatedButHandler +{ + +} + +/** + * @deprecated It's also deprecated, but it will be removed in version 1.0.0 + */ +class AlsoDeprecatedButHandler +{ + +} + diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index 96900de2..62935860 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -153,3 +153,19 @@ interface DoNotCareHandler { } + +/** + * @deprecated This interface will be removed in version 1.0.0 + */ +interface DeprecatedButHandler +{ + +} + +/** + * @deprecated Yeah! This interface will be removed in version 1.0.0 + */ +interface AlsoDeprecatedButHandler +{ + +} diff --git a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc index 62e9688f..1c85b175 100644 --- a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc +++ b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc @@ -194,4 +194,10 @@ class correctlyFormattedClassMemberDocBlock * @see Message with some reference */ protected string $itIsCorrect; + + /** + * @var string + * @deprecated This property will be removed in version 1.0.0 + */ + protected string $deprecatedWithKeyword; } diff --git a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc index 12b89834..a75730e6 100644 --- a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc @@ -63,4 +63,14 @@ class Profiler * @see */ const d = 100; + + /** + * @deprecated This constant will be removed in version 1.0.0 + */ + const KEYWORD_PHRASE = false; + + /** + * @deprecated It's awesome - This constant will be removed in version 1.0.0 + */ + const WITH_KEYWORD_PHRASE = false; } From 922e1080bde3ed1560075fa87fc10720097a3b9a Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Wed, 31 Aug 2022 17:57:49 +0200 Subject: [PATCH 05/27] Add without replacement --- Magento2/Helpers/Commenting/PHPDocFormattingValidator.php | 8 +++++--- .../Annotation/MethodAnnotationStructureUnitTest.inc | 4 ++-- .../ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 4 ++-- .../ClassAndInterfacePHPDocFormattingUnitTest.2.inc | 4 ++-- .../Commenting/ClassPropertyPHPDocFormattingUnitTest.inc | 2 +- .../Commenting/ConstantsPHPDocFormattingUnitTest.2.inc | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index 3421b8a1..a5f33d8c 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -14,6 +14,7 @@ class PHPDocFormattingValidator { private const REMOVED_IN_VERSION = 'removed in version'; + private const WITHOUT_REPLACEMENT = 'without replacement'; /** * Finds matching PHPDoc for current pointer @@ -125,10 +126,11 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - if (!stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0)) { - return false; + if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) && + stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0)) { + return true; } - return true; + return false; } return $tokens[$seePtr + 2]['code'] === T_DOC_COMMENT_STRING; diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 6b7431c9..4ee0c4fa 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -373,7 +373,7 @@ class MethodAnnotationFixture /** * This deprecated function is correct even though it only contains the @deprecated tag. * - * @deprecated It will be removed in version 1.0.0 + * @deprecated It will be removed in version 1.0.0 without replacement */ public function correctBecauseOfKeywordPhrase() { @@ -383,7 +383,7 @@ class MethodAnnotationFixture /** * This deprecated function is correct even though it only contains the @deprecated tag. * - * @deprecated WOW! It will be removed in version 1.0.0 + * @deprecated WOW! It will be removed in version 1.0.0 without replacement */ public function alsoCorrectBecauseOfKeywordPhrase() { diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index c9785e18..0dc9728b 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -164,7 +164,7 @@ class OldHandler } /** - * @deprecated It will be removed in version 1.0.0 + * @deprecated It will be removed in version 1.0.0 without replacement */ class DeprecatedButHandler { @@ -172,7 +172,7 @@ class DeprecatedButHandler } /** - * @deprecated It's also deprecated, but it will be removed in version 1.0.0 + * @deprecated It's also deprecated, but it will be removed in version 1.0.0 without replacement */ class AlsoDeprecatedButHandler { diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc index 62935860..c1c456ed 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.2.inc @@ -155,7 +155,7 @@ interface DoNotCareHandler } /** - * @deprecated This interface will be removed in version 1.0.0 + * @deprecated This interface will be removed in version 1.0.0 without replacement */ interface DeprecatedButHandler { @@ -163,7 +163,7 @@ interface DeprecatedButHandler } /** - * @deprecated Yeah! This interface will be removed in version 1.0.0 + * @deprecated Yeah! This interface will be removed in version 1.0.0 without replacement */ interface AlsoDeprecatedButHandler { diff --git a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc index 1c85b175..cde71269 100644 --- a/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc +++ b/Magento2/Tests/Commenting/ClassPropertyPHPDocFormattingUnitTest.inc @@ -197,7 +197,7 @@ class correctlyFormattedClassMemberDocBlock /** * @var string - * @deprecated This property will be removed in version 1.0.0 + * @deprecated This property will be removed in version 1.0.0 without replacement */ protected string $deprecatedWithKeyword; } diff --git a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc index a75730e6..a751d8aa 100644 --- a/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc +++ b/Magento2/Tests/Commenting/ConstantsPHPDocFormattingUnitTest.2.inc @@ -65,12 +65,12 @@ class Profiler const d = 100; /** - * @deprecated This constant will be removed in version 1.0.0 + * @deprecated This constant will be removed in version 1.0.0 without replacement */ const KEYWORD_PHRASE = false; /** - * @deprecated It's awesome - This constant will be removed in version 1.0.0 + * @deprecated It's awesome - This constant will be removed in version 1.0.0 without replacement */ const WITH_KEYWORD_PHRASE = false; } From 30bed9501a88b21f57eb80f0cc2b83496ef5eb1b Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Wed, 31 Aug 2022 18:03:37 +0200 Subject: [PATCH 06/27] Update condition for stripos --- Magento2/Helpers/Commenting/PHPDocFormattingValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index a5f33d8c..fc9dc419 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -126,8 +126,8 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) && - stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0)) { + if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) >= 0 && + stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0) >= 0) { return true; } return false; From 180c5105e13e3323a738d1f205edf26652502f4a Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Wed, 31 Aug 2022 18:07:49 +0200 Subject: [PATCH 07/27] Update boolean comparison on condition --- Magento2/Helpers/Commenting/PHPDocFormattingValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index fc9dc419..c8761992 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -126,8 +126,8 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) >= 0 && - stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0) >= 0) { + if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) !== false && + stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0) !== false) { return true; } return false; From 8ba38f702ef5405fe79e48a8ebae4473c3fd9149 Mon Sep 17 00:00:00 2001 From: Karyna Tsymbal Date: Wed, 31 Aug 2022 18:23:21 +0200 Subject: [PATCH 08/27] Add eliminated classes to Magento coding standards in Legacy\RestrictedCodeSniff --- .../Legacy/_files/restricted_classes.php | 244 ++++++++++++++++++ 1 file changed, 244 insertions(+) diff --git a/Magento2/Sniffs/Legacy/_files/restricted_classes.php b/Magento2/Sniffs/Legacy/_files/restricted_classes.php index ed6d2540..3dedf871 100644 --- a/Magento2/Sniffs/Legacy/_files/restricted_classes.php +++ b/Magento2/Sniffs/Legacy/_files/restricted_classes.php @@ -29,6 +29,250 @@ 'Magento/Framework/DB/Adapter/Pdo/Mysql.php' ] ], + 'Zend_Json' => [ + 'warning_code' => 'ZendJsonIsRestricted', + 'replacement' => 'Magento\Framework\Serialize\Serializer\Json' + ], + 'Zend_Json_Exception' => [ + 'warning_code' => 'ZendJsonIsRestricted', + 'replacement' => '\InvalidArgumentException' + ], + 'Zend_Acl' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Acl' + ], + 'Zend_Acl_Role' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Role\GenericRole' + ], + 'Zend_Acl_Resource' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Resource\GenericResource' + ], + 'Zend_Acl_Role_Registry' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Role\Registry' + ], + 'Zend_Acl_Role_Registry_Exception' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException' + ], + 'Zend_Acl_Exception' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException' + ], + 'Zend_Acl_Role_Interface' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Laminas\Permissions\Acl\Role\RoleInterface' + ], + 'Zend_Currency' => [ + 'warning_code' => 'ZendAclIsRestricted', + 'replacement' => 'Magento\Framework\Currency\Data\Currency' + ], + 'Zend_Currency_Exception' => [ + 'warning_code' => 'ZendCurrencyIsRestricted', + 'replacement' => 'Magento\Framework\Currency\Exception\CurrencyException' + ], + 'Zend_Oauth_Http_Utility' => [ + 'warning_code' => 'ZendOauthIsRestricted', + 'replacement' => 'Laminas\OAuth\Http\Utility' + ], + 'Zend_Measure_Weight' => [ + 'warning_code' => 'ZendMeasureIsRestricted', + 'replacement' => 'Magento\Framework\Measure\Weight' + ], + 'Zend_Measure_Length' => [ + 'warning_code' => 'ZendMeasureIsRestricted', + 'replacement' => 'Magento\Framework\Measure\Length' + ], + 'Zend_Validate' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\ValidatorChain' + ], + 'Zend_Validate_Regex' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Regex' + ], + 'Zend_Validate_Interface' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\ValidatorInterface' + ], + 'Zend_Validate_EmailAddress' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\EmailAddress' + ], + 'Zend_Validate_StringLength' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\StringLength' + ], + 'Zend_Validate_Exception' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\ValidateException' + ], + 'Zend_Validate_File_ExcludeExtension' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\ExcludeExtension' + ], + 'Zend_Validate_File_Extension' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\Extension' + ], + 'Zend_Validate_File_ImageSize' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\ImageSize' + ], + 'Zend_Validate_File_FilesSize' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\FilesSize' + ], + 'Zend_Validate_Alnum' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\Alnum' + ], + 'Zend_Validate_Hostname' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\Hostname' + ], + 'Zend_Validate_Date' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Date' + ], + 'Zend_Validate_Digits' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Digits' + ], + 'Zend_Validate_Alpha' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\I18n\Validator\Alpha' + ], + 'Zend_Validate_InArray' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\InArray' + ], + 'Zend_Validate_Abstract' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\AbstractValidator' + ], + 'Zend_Validate_NotEmpty' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Magento\Framework\Validator\NotEmpty' + ], + 'Zend_Validate_Callback' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Callback' + ], + 'Zend_Validate_Ip' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Ip' + ], + 'Zend_Validate_Identical' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\Identical' + ], + 'Zend_Validate_File_IsImage' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\IsImage' + ], + 'Zend_Validate_File_Size' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\Validator\File\FilesSize' + ], + 'Zend_Validate_Float' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\I18n\Validator\IsFloat' + ], + 'Zend_Validate_Int' => [ + 'warning_code' => 'ZendValidateIsRestricted', + 'replacement' => 'Laminas\I18n\Validator\IsInt' + ], + 'Magento\Framework\HTTP\ZendClient' => [ + 'warning_code' => 'HttpZendClientIsRestricted', + 'replacement' => 'Magento\Framework\HTTP\LaminasClient' + ], + 'Magento\Framework\HTTP\ZendClientFactory' => [ + 'warning_code' => 'HttpZendClientFactoryIsRestricted', + 'replacement' => 'Magento\Framework\HTTP\LaminasClientFactory' + ], + 'Zend_Http_Client' => [ + 'warning_code' => 'ZendHttpIsRestricted', + 'replacement' => 'Laminas\Http\Request' + ], + 'Zend_Http_Response' => [ + 'warning_code' => 'ZendHttpIsRestricted', + 'replacement' => 'Laminas\Http\Response' + ], + 'Zend_Http_Exception' => [ + 'warning_code' => 'ZendHttpIsRestricted', + 'replacement' => 'Laminas\Http\Exception\RuntimeException' + ], + 'Zend_Http_Client_Exception' => [ + 'warning_code' => 'ZendHttpIsRestricted', + 'replacement' => 'Laminas\Http\Exception\RuntimeException' + ], + 'Zend_Http_Client_Adapter_Interface' => [ + 'warning_code' => 'ZendHttpIsRestricted', + 'replacement' => 'Laminas\Http\Client\Adapter\AdapterInterface' + ], + 'Zend_Filter_File_Rename' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\Filter\File\Rename' + ], + 'Zend_Filter' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Magento\Framework\Filter\FilterInput' + ], + 'Zend_Filter_Input' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Magento\Framework\Filter\FilterInput' + ], + 'Zend_Filter_Interface' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\Filter\FilterInterface' + ], + 'Zend_Filter_LocalizedToNormalized' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Magento\Framework\Filter\LocalizedToNormalized' + ], + 'Zend_Filter_Decrypt' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\Filter\Decrypt' + ], + 'Zend_Filter_Encrypt' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\Filter\Encrypt' + ], + 'Zend_Filter_Encrypt_Interface' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\Filter\Encrypt\EncryptionAlgorithmInterface' + ], + 'Zend_Filter_Alnum' => [ + 'warning_code' => 'ZendFilterIsRestricted', + 'replacement' => 'Laminas\I18n\Filter\Alnum' + ], + 'Zend_Translate_Adapter' => [ + 'warning_code' => 'ZendTranslateIsRestricted', + 'replacement' => 'Laminas\I18n\View\Helper\AbstractTranslatorHelper' + ], + 'Zend_File_Transfer_Exception' => [ + 'warning_code' => 'ZendFileIsRestricted', + 'replacement' => 'Laminas\File\Transfer\Exception\PhpEnvironmentException' + ], + 'Zend_File_Transfer_Adapter_Http' => [ + 'warning_code' => 'ZendFileIsRestricted', + 'replacement' => 'Magento\Framework\File\Http' + ], + 'Zend_File_Transfer' => [ + 'warning_code' => 'ZendFileIsRestricted', + 'replacement' => 'Laminas\File\Transfer\Transfer' + ], + 'Zend_Date' => [ + 'warning_code' => 'ZendDateIsRestricted', + 'replacement' => '\IntlDateFormatter' + ], + 'Zend_Locale_Format' => [ + 'warning_code' => 'ZendLocaleFormatIsRestricted', + 'replacement' => 'Laminas\I18n\Filter\NumberParse, \NumberFormatter, \IntlDateFormatter' + ], 'Magento\Framework\Serialize\Serializer\Serialize' => [ 'warning_code' => 'SerializerSerializeIsRestricted', 'replacement' => 'Magento\Framework\Serialize\SerializerInterface', From 246c67bcf8d75985cad8effce3faa85a5143cae6 Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Thu, 1 Sep 2022 12:25:10 +0200 Subject: [PATCH 09/27] Refactor: Use preg_match --- .../Helpers/Commenting/PHPDocFormattingValidator.php | 9 ++++----- .../Annotation/MethodAnnotationStructureUnitTest.inc | 4 ++-- .../ClassAndInterfacePHPDocFormattingUnitTest.1.inc | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php index c8761992..a87312d5 100644 --- a/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php +++ b/Magento2/Helpers/Commenting/PHPDocFormattingValidator.php @@ -13,9 +13,6 @@ */ class PHPDocFormattingValidator { - private const REMOVED_IN_VERSION = 'removed in version'; - private const WITHOUT_REPLACEMENT = 'without replacement'; - /** * Finds matching PHPDoc for current pointer * @@ -126,8 +123,10 @@ public function hasDeprecatedWellFormatted($commentStartPtr, $tokens) } $seePtr = $this->getTagPosition('@see', $commentStartPtr, $tokens); if ($seePtr === -1) { - if (stripos($tokens[$deprecatedPtr + 2]['content'], self::REMOVED_IN_VERSION, 0) !== false && - stripos($tokens[$deprecatedPtr + 2]['content'], self::WITHOUT_REPLACEMENT, 0) !== false) { + if (preg_match( + "/This [a-zA-Z]* will be removed in version \d.\d.\d without replacement/", + $tokens[$deprecatedPtr + 2]['content'] + )) { return true; } return false; diff --git a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc index 4ee0c4fa..2e0fdf0e 100644 --- a/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc +++ b/Magento2/Tests/Annotation/MethodAnnotationStructureUnitTest.inc @@ -373,7 +373,7 @@ class MethodAnnotationFixture /** * This deprecated function is correct even though it only contains the @deprecated tag. * - * @deprecated It will be removed in version 1.0.0 without replacement + * @deprecated This method will be removed in version 1.0.0 without replacement */ public function correctBecauseOfKeywordPhrase() { @@ -383,7 +383,7 @@ class MethodAnnotationFixture /** * This deprecated function is correct even though it only contains the @deprecated tag. * - * @deprecated WOW! It will be removed in version 1.0.0 without replacement + * @deprecated WOW! This method will be removed in version 1.0.0 without replacement */ public function alsoCorrectBecauseOfKeywordPhrase() { diff --git a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc index 0dc9728b..afd4c934 100644 --- a/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc +++ b/Magento2/Tests/Commenting/ClassAndInterfacePHPDocFormattingUnitTest.1.inc @@ -164,7 +164,7 @@ class OldHandler } /** - * @deprecated It will be removed in version 1.0.0 without replacement + * @deprecated This class will be removed in version 1.0.0 without replacement */ class DeprecatedButHandler { @@ -172,7 +172,7 @@ class DeprecatedButHandler } /** - * @deprecated It's also deprecated, but it will be removed in version 1.0.0 without replacement + * @deprecated It's also deprecated - This class will be removed in version 1.0.0 without replacement */ class AlsoDeprecatedButHandler { From 10001607376f34388954e7f99ce4aa4d52c06fd7 Mon Sep 17 00:00:00 2001 From: Maksym Aposov Date: Tue, 13 Sep 2022 10:52:59 -0500 Subject: [PATCH 10/27] Add eliminated classes to Magento coding standards in Legacy\RestrictedCodeSniff --- .../Legacy/_files/restricted_classes.php | 183 ++++++++++++------ 1 file changed, 122 insertions(+), 61 deletions(-) diff --git a/Magento2/Sniffs/Legacy/_files/restricted_classes.php b/Magento2/Sniffs/Legacy/_files/restricted_classes.php index 3dedf871..3269caca 100644 --- a/Magento2/Sniffs/Legacy/_files/restricted_classes.php +++ b/Magento2/Sniffs/Legacy/_files/restricted_classes.php @@ -31,247 +31,308 @@ ], 'Zend_Json' => [ 'warning_code' => 'ZendJsonIsRestricted', - 'replacement' => 'Magento\Framework\Serialize\Serializer\Json' + 'replacement' => 'Magento\Framework\Serialize\Serializer\Json', + 'exclude' => [] ], 'Zend_Json_Exception' => [ 'warning_code' => 'ZendJsonIsRestricted', - 'replacement' => '\InvalidArgumentException' + 'replacement' => '\InvalidArgumentException', + 'exclude' => [] ], 'Zend_Acl' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Acl' + 'replacement' => 'Laminas\Permissions\Acl\Acl', + 'exclude' => [] ], 'Zend_Acl_Role' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Role\GenericRole' + 'replacement' => 'Laminas\Permissions\Acl\Role\GenericRole', + 'exclude' => [] ], 'Zend_Acl_Resource' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Resource\GenericResource' + 'replacement' => 'Laminas\Permissions\Acl\Resource\GenericResource', + 'exclude' => [] ], 'Zend_Acl_Role_Registry' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Role\Registry' + 'replacement' => 'Laminas\Permissions\Acl\Role\Registry', + 'exclude' => [] ], 'Zend_Acl_Role_Registry_Exception' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException' + 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException', + 'exclude' => [] ], 'Zend_Acl_Exception' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException' + 'replacement' => 'Laminas\Permissions\Acl\Exception\InvalidArgumentException', + 'exclude' => [] ], 'Zend_Acl_Role_Interface' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Laminas\Permissions\Acl\Role\RoleInterface' + 'replacement' => 'Laminas\Permissions\Acl\Role\RoleInterface', + 'exclude' => [] ], 'Zend_Currency' => [ 'warning_code' => 'ZendAclIsRestricted', - 'replacement' => 'Magento\Framework\Currency\Data\Currency' + 'replacement' => 'Magento\Framework\Currency\Data\Currency', + 'exclude' => [] ], 'Zend_Currency_Exception' => [ 'warning_code' => 'ZendCurrencyIsRestricted', - 'replacement' => 'Magento\Framework\Currency\Exception\CurrencyException' + 'replacement' => 'Magento\Framework\Currency\Exception\CurrencyException', + 'exclude' => [] ], 'Zend_Oauth_Http_Utility' => [ 'warning_code' => 'ZendOauthIsRestricted', - 'replacement' => 'Laminas\OAuth\Http\Utility' + 'replacement' => 'Laminas\OAuth\Http\Utility', + 'exclude' => [] ], 'Zend_Measure_Weight' => [ 'warning_code' => 'ZendMeasureIsRestricted', - 'replacement' => 'Magento\Framework\Measure\Weight' + 'replacement' => 'Magento\Framework\Measure\Weight', + 'exclude' => [] ], 'Zend_Measure_Length' => [ 'warning_code' => 'ZendMeasureIsRestricted', - 'replacement' => 'Magento\Framework\Measure\Length' + 'replacement' => 'Magento\Framework\Measure\Length', + 'exclude' => [] ], 'Zend_Validate' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\ValidatorChain' + 'replacement' => 'Magento\Framework\Validator\ValidatorChain', + 'exclude' => [] ], 'Zend_Validate_Regex' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Regex' + 'replacement' => 'Laminas\Validator\Regex', + 'exclude' => [] ], 'Zend_Validate_Interface' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\ValidatorInterface' + 'replacement' => 'Laminas\Validator\ValidatorInterface', + 'exclude' => [] ], 'Zend_Validate_EmailAddress' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\EmailAddress' + 'replacement' => 'Magento\Framework\Validator\EmailAddress', + 'exclude' => [] ], 'Zend_Validate_StringLength' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\StringLength' + 'replacement' => 'Magento\Framework\Validator\StringLength', + 'exclude' => [] ], 'Zend_Validate_Exception' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\ValidateException' + 'replacement' => 'Magento\Framework\Validator\ValidateException', + 'exclude' => [] ], 'Zend_Validate_File_ExcludeExtension' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\ExcludeExtension' + 'replacement' => 'Laminas\Validator\File\ExcludeExtension', + 'exclude' => [] ], 'Zend_Validate_File_Extension' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\Extension' + 'replacement' => 'Laminas\Validator\File\Extension', + 'exclude' => [] ], 'Zend_Validate_File_ImageSize' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\ImageSize' + 'replacement' => 'Laminas\Validator\File\ImageSize', + 'exclude' => [] ], 'Zend_Validate_File_FilesSize' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\FilesSize' + 'replacement' => 'Laminas\Validator\File\FilesSize', + 'exclude' => [] ], 'Zend_Validate_Alnum' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\Alnum' + 'replacement' => 'Magento\Framework\Validator\Alnum', + 'exclude' => [] ], 'Zend_Validate_Hostname' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\Hostname' + 'replacement' => 'Magento\Framework\Validator\Hostname', + 'exclude' => [] ], 'Zend_Validate_Date' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Date' + 'replacement' => 'Laminas\Validator\Date', + 'exclude' => [] ], 'Zend_Validate_Digits' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Digits' + 'replacement' => 'Laminas\Validator\Digits', + 'exclude' => [] ], 'Zend_Validate_Alpha' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\I18n\Validator\Alpha' + 'replacement' => 'Laminas\I18n\Validator\Alpha', + 'exclude' => [] ], 'Zend_Validate_InArray' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\InArray' + 'replacement' => 'Laminas\Validator\InArray', + 'exclude' => [] ], 'Zend_Validate_Abstract' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\AbstractValidator' + 'replacement' => 'Laminas\Validator\AbstractValidator', + 'exclude' => [] ], 'Zend_Validate_NotEmpty' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Magento\Framework\Validator\NotEmpty' + 'replacement' => 'Magento\Framework\Validator\NotEmpty', + 'exclude' => [] ], 'Zend_Validate_Callback' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Callback' + 'replacement' => 'Laminas\Validator\Callback', + 'exclude' => [] ], 'Zend_Validate_Ip' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Ip' + 'replacement' => 'Laminas\Validator\Ip', + 'exclude' => [] ], 'Zend_Validate_Identical' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\Identical' + 'replacement' => 'Laminas\Validator\Identical', + 'exclude' => [] ], 'Zend_Validate_File_IsImage' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\IsImage' + 'replacement' => 'Laminas\Validator\File\IsImage', + 'exclude' => [] ], 'Zend_Validate_File_Size' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\Validator\File\FilesSize' + 'replacement' => 'Laminas\Validator\File\FilesSize', + 'exclude' => [] ], 'Zend_Validate_Float' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\I18n\Validator\IsFloat' + 'replacement' => 'Laminas\I18n\Validator\IsFloat', + 'exclude' => [] ], 'Zend_Validate_Int' => [ 'warning_code' => 'ZendValidateIsRestricted', - 'replacement' => 'Laminas\I18n\Validator\IsInt' + 'replacement' => 'Laminas\I18n\Validator\IsInt', + 'exclude' => [] ], 'Magento\Framework\HTTP\ZendClient' => [ 'warning_code' => 'HttpZendClientIsRestricted', - 'replacement' => 'Magento\Framework\HTTP\LaminasClient' + 'replacement' => 'Magento\Framework\HTTP\LaminasClient', + 'exclude' => [] ], 'Magento\Framework\HTTP\ZendClientFactory' => [ 'warning_code' => 'HttpZendClientFactoryIsRestricted', - 'replacement' => 'Magento\Framework\HTTP\LaminasClientFactory' + 'replacement' => 'Magento\Framework\HTTP\LaminasClientFactory', + 'exclude' => [] ], 'Zend_Http_Client' => [ 'warning_code' => 'ZendHttpIsRestricted', - 'replacement' => 'Laminas\Http\Request' + 'replacement' => 'Laminas\Http\Request', + 'exclude' => [] ], 'Zend_Http_Response' => [ 'warning_code' => 'ZendHttpIsRestricted', - 'replacement' => 'Laminas\Http\Response' + 'replacement' => 'Laminas\Http\Response', + 'exclude' => [] ], 'Zend_Http_Exception' => [ 'warning_code' => 'ZendHttpIsRestricted', - 'replacement' => 'Laminas\Http\Exception\RuntimeException' + 'replacement' => 'Laminas\Http\Exception\RuntimeException', + 'exclude' => [] ], 'Zend_Http_Client_Exception' => [ 'warning_code' => 'ZendHttpIsRestricted', - 'replacement' => 'Laminas\Http\Exception\RuntimeException' + 'replacement' => 'Laminas\Http\Exception\RuntimeException', + 'exclude' => [] ], 'Zend_Http_Client_Adapter_Interface' => [ 'warning_code' => 'ZendHttpIsRestricted', - 'replacement' => 'Laminas\Http\Client\Adapter\AdapterInterface' + 'replacement' => 'Laminas\Http\Client\Adapter\AdapterInterface', + 'exclude' => [] ], 'Zend_Filter_File_Rename' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\Filter\File\Rename' + 'replacement' => 'Laminas\Filter\File\Rename', + 'exclude' => [] ], 'Zend_Filter' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Magento\Framework\Filter\FilterInput' + 'replacement' => 'Magento\Framework\Filter\FilterInput', + 'exclude' => [] ], 'Zend_Filter_Input' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Magento\Framework\Filter\FilterInput' + 'replacement' => 'Magento\Framework\Filter\FilterInput', + 'exclude' => [] ], 'Zend_Filter_Interface' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\Filter\FilterInterface' + 'replacement' => 'Laminas\Filter\FilterInterface', + 'exclude' => [] ], 'Zend_Filter_LocalizedToNormalized' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Magento\Framework\Filter\LocalizedToNormalized' + 'replacement' => 'Magento\Framework\Filter\LocalizedToNormalized', + 'exclude' => [] ], 'Zend_Filter_Decrypt' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\Filter\Decrypt' + 'replacement' => 'Laminas\Filter\Decrypt', + 'exclude' => [] ], 'Zend_Filter_Encrypt' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\Filter\Encrypt' + 'replacement' => 'Laminas\Filter\Encrypt', + 'exclude' => [] ], 'Zend_Filter_Encrypt_Interface' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\Filter\Encrypt\EncryptionAlgorithmInterface' + 'replacement' => 'Laminas\Filter\Encrypt\EncryptionAlgorithmInterface', + 'exclude' => [] ], 'Zend_Filter_Alnum' => [ 'warning_code' => 'ZendFilterIsRestricted', - 'replacement' => 'Laminas\I18n\Filter\Alnum' + 'replacement' => 'Laminas\I18n\Filter\Alnum', + 'exclude' => [] ], 'Zend_Translate_Adapter' => [ 'warning_code' => 'ZendTranslateIsRestricted', - 'replacement' => 'Laminas\I18n\View\Helper\AbstractTranslatorHelper' + 'replacement' => 'Laminas\I18n\View\Helper\AbstractTranslatorHelper', + 'exclude' => [] ], 'Zend_File_Transfer_Exception' => [ 'warning_code' => 'ZendFileIsRestricted', - 'replacement' => 'Laminas\File\Transfer\Exception\PhpEnvironmentException' + 'replacement' => 'Laminas\File\Transfer\Exception\PhpEnvironmentException', + 'exclude' => [] ], 'Zend_File_Transfer_Adapter_Http' => [ 'warning_code' => 'ZendFileIsRestricted', - 'replacement' => 'Magento\Framework\File\Http' + 'replacement' => 'Magento\Framework\File\Http', + 'exclude' => [] ], 'Zend_File_Transfer' => [ 'warning_code' => 'ZendFileIsRestricted', - 'replacement' => 'Laminas\File\Transfer\Transfer' + 'replacement' => 'Laminas\File\Transfer\Transfer', + 'exclude' => [] ], 'Zend_Date' => [ 'warning_code' => 'ZendDateIsRestricted', - 'replacement' => '\IntlDateFormatter' + 'replacement' => '\IntlDateFormatter', + 'exclude' => [] ], 'Zend_Locale_Format' => [ 'warning_code' => 'ZendLocaleFormatIsRestricted', - 'replacement' => 'Laminas\I18n\Filter\NumberParse, \NumberFormatter, \IntlDateFormatter' + 'replacement' => 'Laminas\I18n\Filter\NumberParse, \NumberFormatter, \IntlDateFormatter', + 'exclude' => [] ], 'Magento\Framework\Serialize\Serializer\Serialize' => [ 'warning_code' => 'SerializerSerializeIsRestricted', From 9b16a9466554c4c10c250bd6642754d8ecce1cf9 Mon Sep 17 00:00:00 2001 From: Faizan Shaikh Date: Fri, 23 Sep 2022 17:55:27 +0530 Subject: [PATCH 11/27] AC-6437:Ensure PHP8.1 support after 7.4 removal - Added support for ReflectionIntersection and ReflectionUnion Type variables --- .../Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php b/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php index f05cc78b..3732e2ac 100644 --- a/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php +++ b/Magento2/Sniffs/Commenting/ClassPropertyPHPDocFormattingSniff.php @@ -29,7 +29,9 @@ class ClassPropertyPHPDocFormattingSniff extends AbstractVariableSniff T_NS_SEPARATOR, T_STRING, T_COMMENT, - T_NULLABLE + T_NULLABLE, + T_BITWISE_AND, + T_TYPE_UNION, ]; /** From 0397552687706e3fcd66b19caf3aa90389ae9b76 Mon Sep 17 00:00:00 2001 From: Rafal Janicki Date: Tue, 4 Oct 2022 11:00:48 +0100 Subject: [PATCH 12/27] Release v26 --- composer.json | 2 +- composer.lock | 436 +++++++++----------------------------------------- 2 files changed, 76 insertions(+), 362 deletions(-) diff --git a/composer.json b/composer.json index 69f6abaf..13e73cce 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "25", + "version": "26", "require": { "php": ">=7.3", "webonyx/graphql-php": "^14.9", diff --git a/composer.lock b/composer.lock index 563cd8b9..17a2656d 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": "4545f720f14d1d67c1b4684e624da98b", + "content-hash": "c3fda2a5a3535f9eff0880e5ddc61827", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -70,16 +70,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.7.13", + "version": "1.8.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "86ffc063bfd8f264c9eba568e84b0225a6090d09" + "reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/86ffc063bfd8f264c9eba568e84b0225a6090d09", - "reference": "86ffc063bfd8f264c9eba568e84b0225a6090d09", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c386ab2741e64cc9e21729f891b28b2b10fe6618", + "reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618", "shasum": "" }, "require": { @@ -103,9 +103,13 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.7.13" + "source": "https://github.com/phpstan/phpstan/tree/1.8.6" }, "funding": [ { @@ -116,37 +120,33 @@ "url": "https://github.com/phpstan", "type": "github" }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, { "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", "type": "tidelift" } ], - "time": "2022-06-13T15:15:39+00:00" + "time": "2022-09-23T09:54:39+00:00" }, { "name": "rector/rector", - "version": "0.13.5", + "version": "0.13.10", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "4170aad2943b150149ba9594c34539e06ced6c6b" + "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/4170aad2943b150149ba9594c34539e06ced6c6b", - "reference": "4170aad2943b150149ba9594c34539e06ced6c6b", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/d1e069db8ad3b4aea2b968248370c21415e4c180", + "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.7.10" + "phpstan/phpstan": "^1.8.2" }, "conflict": { - "phpstan/phpdoc-parser": "<1.2", + "phpstan/phpdoc-parser": "<1.6.2", "rector/rector-cakephp": "*", "rector/rector-doctrine": "*", "rector/rector-laravel": "*", @@ -177,7 +177,7 @@ "description": "Instant Upgrade and Automated Refactoring of any PHP code", "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.13.5" + "source": "https://github.com/rectorphp/rector/tree/0.13.10" }, "funding": [ { @@ -185,20 +185,20 @@ "type": "github" } ], - "time": "2022-06-09T12:54:02+00:00" + "time": "2022-08-03T12:48:10+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.0", + "version": "3.7.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563" + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563", - "reference": "a2cd51b45bcaef9c1f2a4bda48f2dd2fa2b95563", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", "shasum": "" }, "require": { @@ -241,20 +241,20 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-13T06:31:38+00:00" + "time": "2022-06-18T07:21:10+00:00" }, { "name": "webonyx/graphql-php", - "version": "v14.11.6", + "version": "v14.11.8", "source": { "type": "git", "url": "https://github.com/webonyx/graphql-php.git", - "reference": "6070542725b61fc7d0654a8a9855303e5e157434" + "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/6070542725b61fc7d0654a8a9855303e5e157434", - "reference": "6070542725b61fc7d0654a8a9855303e5e157434", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/04a48693acd785330eefd3b0e4fa67df8dfee7c3", + "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3", "shasum": "" }, "require": { @@ -299,7 +299,7 @@ ], "support": { "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v14.11.6" + "source": "https://github.com/webonyx/graphql-php/tree/v14.11.8" }, "funding": [ { @@ -307,7 +307,7 @@ "type": "open_collective" } ], - "time": "2022-04-13T16:25:32+00:00" + "time": "2022-09-21T15:35:03+00:00" } ], "packages-dev": [ @@ -442,16 +442,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", "shasum": "" }, "require": { @@ -492,9 +492,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-09-04T07:30:47+00:00" }, { "name": "phar-io/manifest", @@ -607,252 +607,25 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", + "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -901,7 +674,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" }, "funding": [ { @@ -909,7 +682,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-08-30T12:24:04+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1154,16 +927,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.20", + "version": "9.5.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba" + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/12bc8879fb65aef2138b26fc633cb1e3620cffba", - "reference": "12bc8879fb65aef2138b26fc633cb1e3620cffba", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", "shasum": "" }, "require": { @@ -1178,7 +951,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -1186,20 +958,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -1241,7 +1009,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.20" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" }, "funding": [ { @@ -1251,9 +1019,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-04-01T12:37:26+00:00" + "time": "2022-09-25T03:44:45+00:00" }, { "name": "sebastian/cli-parser", @@ -1424,16 +1196,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -1486,7 +1258,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -1494,7 +1266,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -1684,16 +1456,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -1749,7 +1521,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1757,7 +1529,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -2112,16 +1884,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -2133,7 +1905,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -2156,7 +1928,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -2164,7 +1936,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -2268,64 +2040,6 @@ } ], "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], From c183421a25aec235cb400fb9260112410a88c404 Mon Sep 17 00:00:00 2001 From: Faizan Shaikh Date: Fri, 14 Oct 2022 18:20:19 +0530 Subject: [PATCH 13/27] AC-6437:Ensure PHP8.1 support after 7.4 removal - Release v27 --- composer.json | 4 ++-- composer.lock | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 13e73cce..07e01770 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "26", + "version": "27", "require": { - "php": ">=7.3", + "php": "^8.1||^8.2", "webonyx/graphql-php": "^14.9", "ext-simplexml": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 17a2656d..b62791c4 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": "c3fda2a5a3535f9eff0880e5ddc61827", + "content-hash": "a50d1c346c96a8ad6ecdc3d142d1fc3e", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -70,16 +70,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.8.6", + "version": "1.8.9", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618" + "reference": "3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c386ab2741e64cc9e21729f891b28b2b10fe6618", - "reference": "c386ab2741e64cc9e21729f891b28b2b10fe6618", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2", + "reference": "3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2", "shasum": "" }, "require": { @@ -109,7 +109,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.6" + "source": "https://github.com/phpstan/phpstan/tree/1.8.9" }, "funding": [ { @@ -125,7 +125,7 @@ "type": "tidelift" } ], - "time": "2022-09-23T09:54:39+00:00" + "time": "2022-10-13T13:40:18+00:00" }, { "name": "rector/rector", @@ -2048,7 +2048,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.3", + "php": "^8.1||^8.2", "ext-simplexml": "*", "ext-dom": "*" }, From 5fd9e4ced3a9df60d334391101d90fdfca12054f Mon Sep 17 00:00:00 2001 From: Faizan Shaikh Date: Fri, 14 Oct 2022 18:37:32 +0530 Subject: [PATCH 14/27] AC-6437:Ensure PHP8.1 support after 7.4 removal --- .github/workflows/php.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e579cf3c..f4472119 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,9 +13,6 @@ jobs: fail-fast: false matrix: php-version: - - "7.3" - - "7.4" - - "8.0" - "8.1" dependencies: - "lowest" From 1798cf49dd752411f373e2fb3e7d028289fc7311 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sat, 15 Oct 2022 12:02:16 +0100 Subject: [PATCH 15/27] Fix PHP error with short class names --- Magento2/Sniffs/Less/ClassNamingSniff.php | 3 ++- Magento2/Tests/Less/ClassNamingUnitTest.less | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Magento2/Sniffs/Less/ClassNamingSniff.php b/Magento2/Sniffs/Less/ClassNamingSniff.php index e684172b..9a2e1dd0 100644 --- a/Magento2/Sniffs/Less/ClassNamingSniff.php +++ b/Magento2/Sniffs/Less/ClassNamingSniff.php @@ -66,7 +66,8 @@ public function process(File $phpcsFile, $stackPtr) [implode("", $matches[0])] ); } - if (strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false) { + + if (strlen($className) > 1 && strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false) { $phpcsFile->addError( 'CSS class names should be separated with "-" (dash) instead of "_" (underscore)', $stackPtr, diff --git a/Magento2/Tests/Less/ClassNamingUnitTest.less b/Magento2/Tests/Less/ClassNamingUnitTest.less index ba60c205..f67a938b 100644 --- a/Magento2/Tests/Less/ClassNamingUnitTest.less +++ b/Magento2/Tests/Less/ClassNamingUnitTest.less @@ -30,3 +30,8 @@ .category-title { background: green; } + +// @see https://github.com/magento/magento-coding-standard/issues/425 +.a { + text-decoration: none; +} From 4e804252838a0516fec4ce5bbf7cb76b904b090b Mon Sep 17 00:00:00 2001 From: Viktor Rad Date: Fri, 2 Dec 2022 10:58:49 -0600 Subject: [PATCH 16/27] AC-7098: Performance issue in TableNameSniff with big array - updated rector/rector because its dependency phpstan/phpstan released 1.9 and caused build to fail --- ...AddArrayAccessInterfaceReturnTypesTest.php | 4 +- .../ReplaceMbStrposNullLimitTest.php | 4 +- .../ReplaceNewDateTimeNullTest.php | 4 +- .../ReplacePregSplitNullLimitTest.php | 4 +- Magento2/Sniffs/Legacy/TableNameSniff.php | 6 +- Magento2/Tests/Legacy/TableNameUnitTest.inc | 2 + Magento2/Tests/Legacy/TableNameUnitTest.php | 2 +- composer.json | 2 +- composer.lock | 73 +++++++++---------- 9 files changed, 51 insertions(+), 50 deletions(-) diff --git a/Magento2/Rector/Tests/AddArrayAccessInterfaceReturnTypes/AddArrayAccessInterfaceReturnTypesTest.php b/Magento2/Rector/Tests/AddArrayAccessInterfaceReturnTypes/AddArrayAccessInterfaceReturnTypesTest.php index 3d53d5aa..89c9bb05 100644 --- a/Magento2/Rector/Tests/AddArrayAccessInterfaceReturnTypes/AddArrayAccessInterfaceReturnTypesTest.php +++ b/Magento2/Rector/Tests/AddArrayAccessInterfaceReturnTypes/AddArrayAccessInterfaceReturnTypesTest.php @@ -16,9 +16,9 @@ class AddArrayAccessInterfaceReturnTypesTest extends AbstractRectorTestCase /** * @dataProvider provideData() */ - public function test(SmartFileInfo $fileInfo): void + public function test(string $fileInfo): void { - $this->doTestFileInfo($fileInfo); + $this->doTestFile($fileInfo); } /** diff --git a/Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php b/Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php index 77a15b75..eb87d394 100644 --- a/Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php +++ b/Magento2/Rector/Tests/ReplaceMbStrposNullLimit/ReplaceMbStrposNullLimitTest.php @@ -16,9 +16,9 @@ class ReplaceMbStrposNullLimitTest extends AbstractRectorTestCase /** * @dataProvider provideData() */ - public function test(SmartFileInfo $fileInfo): void + public function test(string $fileInfo): void { - $this->doTestFileInfo($fileInfo); + $this->doTestFile($fileInfo); } /** diff --git a/Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php b/Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php index fe3c6028..49c3491f 100644 --- a/Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php +++ b/Magento2/Rector/Tests/ReplaceNewDateTimeNull/ReplaceNewDateTimeNullTest.php @@ -16,9 +16,9 @@ class ReplaceNewDateTimeNullTest extends AbstractRectorTestCase /** * @dataProvider provideData() */ - public function test(SmartFileInfo $fileInfo): void + public function test(string $fileInfo): void { - $this->doTestFileInfo($fileInfo); + $this->doTestFile($fileInfo); } /** diff --git a/Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php b/Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php index 5db48332..112bfe0f 100644 --- a/Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php +++ b/Magento2/Rector/Tests/ReplacePregSplitNullLimit/ReplacePregSplitNullLimitTest.php @@ -16,9 +16,9 @@ class ReplacePregSplitNullLimitTest extends AbstractRectorTestCase /** * @dataProvider provideData() */ - public function test(SmartFileInfo $fileInfo): void + public function test(string $fileInfo): void { - $this->doTestFileInfo($fileInfo); + $this->doTestFile($fileInfo); } /** diff --git a/Magento2/Sniffs/Legacy/TableNameSniff.php b/Magento2/Sniffs/Legacy/TableNameSniff.php index b9a9081f..4569f7fc 100644 --- a/Magento2/Sniffs/Legacy/TableNameSniff.php +++ b/Magento2/Sniffs/Legacy/TableNameSniff.php @@ -189,8 +189,10 @@ private function checkOccurrencesInProperty(File $phpcsFile, int $stackPtr, arra private function checkOccurrencesInArray(File $phpcsFile, int $stackPtr, array $tokens): void { $aliasPos = $phpcsFile->findPrevious( - T_CONSTANT_ENCAPSED_STRING, - $stackPtr -1 + T_WHITESPACE, + $stackPtr - 1, + null, + true, ); $alias = trim($tokens[$aliasPos]['content'], '\'"'); diff --git a/Magento2/Tests/Legacy/TableNameUnitTest.inc b/Magento2/Tests/Legacy/TableNameUnitTest.inc index d3b46079..c076adf4 100644 --- a/Magento2/Tests/Legacy/TableNameUnitTest.inc +++ b/Magento2/Tests/Legacy/TableNameUnitTest.inc @@ -28,6 +28,8 @@ $select = $connection->select()->from( ['main_table' => 'magento_sample_table'] ); +$fooBar=array(0=>array(125,0,875,750),'33' =>array(85,0,194,716), 10 => 100); + class Collection extends \Magento\Sales\Model\ResourceModel\Report\Order\Collection { /** diff --git a/Magento2/Tests/Legacy/TableNameUnitTest.php b/Magento2/Tests/Legacy/TableNameUnitTest.php index eec07bfe..3d9ccce0 100644 --- a/Magento2/Tests/Legacy/TableNameUnitTest.php +++ b/Magento2/Tests/Legacy/TableNameUnitTest.php @@ -19,7 +19,7 @@ public function getErrorList($testFile = '') 7 => 1, 16 => 1, 20 => 1, - 38 => 1, + 40 => 1, ]; } diff --git a/composer.json b/composer.json index 07e01770..680863d5 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.13.0" + "rector/rector": "^0.14.8" }, "require-dev": { "phpunit/phpunit": "^9.5.8" diff --git a/composer.lock b/composer.lock index b62791c4..ecfa2b8c 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": "a50d1c346c96a8ad6ecdc3d142d1fc3e", + "content-hash": "c101090e4e439fe14f68b90ca3dde531", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -70,16 +70,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.8.9", + "version": "1.9.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2" + "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2", - "reference": "3a72d9d9f2528fbd50c2d8fcf155fd9f74ade3f2", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", "shasum": "" }, "require": { @@ -109,7 +109,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.9" + "source": "https://github.com/phpstan/phpstan/tree/1.9.2" }, "funding": [ { @@ -125,35 +125,32 @@ "type": "tidelift" } ], - "time": "2022-10-13T13:40:18+00:00" + "time": "2022-11-10T09:56:11+00:00" }, { "name": "rector/rector", - "version": "0.13.10", + "version": "0.14.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180" + "reference": "46ee9a173a2b2645ca92a75ffc17460139fa226e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/d1e069db8ad3b4aea2b968248370c21415e4c180", - "reference": "d1e069db8ad3b4aea2b968248370c21415e4c180", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/46ee9a173a2b2645ca92a75ffc17460139fa226e", + "reference": "46ee9a173a2b2645ca92a75ffc17460139fa226e", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.8.2" + "phpstan/phpstan": "^1.9.0" }, "conflict": { - "phpstan/phpdoc-parser": "<1.6.2", - "rector/rector-cakephp": "*", "rector/rector-doctrine": "*", - "rector/rector-laravel": "*", - "rector/rector-nette": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-php-parser": "*", "rector/rector-phpoffice": "*", "rector/rector-phpunit": "*", - "rector/rector-prefixed": "*", "rector/rector-symfony": "*" }, "bin": [ @@ -162,7 +159,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.13-dev" + "dev-main": "0.14-dev" } }, "autoload": { @@ -177,7 +174,7 @@ "description": "Instant Upgrade and Automated Refactoring of any PHP code", "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.13.10" + "source": "https://github.com/rectorphp/rector/tree/0.14.8" }, "funding": [ { @@ -185,7 +182,7 @@ "type": "github" } ], - "time": "2022-08-03T12:48:10+00:00" + "time": "2022-11-14T14:09:49+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -442,16 +439,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.1", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", - "reference": "0ef6c55a3f47f89d7a374e6f835197a0b5fcf900", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -492,9 +489,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-09-04T07:30:47+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "phar-io/manifest", @@ -609,16 +606,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.17", + "version": "9.2.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8" + "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/aa94dc41e8661fe90c7316849907cba3007b10d8", - "reference": "aa94dc41e8661fe90c7316849907cba3007b10d8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", + "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", "shasum": "" }, "require": { @@ -674,7 +671,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.17" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" }, "funding": [ { @@ -682,7 +679,7 @@ "type": "github" } ], - "time": "2022-08-30T12:24:04+00:00" + "time": "2022-11-18T07:47:47+00:00" }, { "name": "phpunit/php-file-iterator", @@ -927,16 +924,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.25", + "version": "9.5.26", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d" + "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", - "reference": "3e6f90ca7e3d02025b1d147bd8d4a89fd4ca8a1d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", "shasum": "" }, "require": { @@ -1009,7 +1006,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.25" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" }, "funding": [ { @@ -1025,7 +1022,7 @@ "type": "tidelift" } ], - "time": "2022-09-25T03:44:45+00:00" + "time": "2022-10-28T06:00:21+00:00" }, { "name": "sebastian/cli-parser", From 582bfacc7f48be85a6edfe5de3f10f70f04e0f79 Mon Sep 17 00:00:00 2001 From: Viktor Rad Date: Tue, 13 Dec 2022 15:37:11 -0600 Subject: [PATCH 17/27] ACP2E-1466: Release of UCT 3.0.2, Mray 10.0.5, Magento API Index 5.4.3 and Magento Coding Standard 28 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 680863d5..c9f23250 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "27", + "version": "28", "require": { "php": "^8.1||^8.2", "webonyx/graphql-php": "^14.9", From c45120e0bde31d093c3a9bf1e94185f9be87616a Mon Sep 17 00:00:00 2001 From: Viktor Rad Date: Tue, 13 Dec 2022 15:49:50 -0600 Subject: [PATCH 18/27] ACP2E-1466: Release of UCT 3.0.2, Mray 10.0.5, Magento API Index 5.4.3 and Magento Coding Standard 28 --- composer.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/composer.lock b/composer.lock index ecfa2b8c..60a5c8da 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": "c101090e4e439fe14f68b90ca3dde531", + "content-hash": "de9d991dbdaf4c3b0df44666b8600182", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -70,16 +70,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa" + "reference": "709999b91448d4f2bb07daffffedc889b33e461c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d6fdf01c53978b6429f1393ba4afeca39cc68afa", - "reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", + "reference": "709999b91448d4f2bb07daffffedc889b33e461c", "shasum": "" }, "require": { @@ -109,7 +109,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.2" + "source": "https://github.com/phpstan/phpstan/tree/1.9.3" }, "funding": [ { @@ -125,7 +125,7 @@ "type": "tidelift" } ], - "time": "2022-11-10T09:56:11+00:00" + "time": "2022-12-13T10:28:10+00:00" }, { "name": "rector/rector", @@ -606,16 +606,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.19", + "version": "9.2.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" + "reference": "af7463c955007de36db0c5e26d03e2f933c2e980" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980", + "reference": "af7463c955007de36db0c5e26d03e2f933c2e980", "shasum": "" }, "require": { @@ -671,7 +671,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20" }, "funding": [ { @@ -679,7 +679,7 @@ "type": "github" } ], - "time": "2022-11-18T07:47:47+00:00" + "time": "2022-12-13T07:49:28+00:00" }, { "name": "phpunit/php-file-iterator", @@ -924,16 +924,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.26", + "version": "9.5.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", "shasum": "" }, "require": { @@ -1006,7 +1006,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" }, "funding": [ { @@ -1022,7 +1022,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T06:00:21+00:00" + "time": "2022-12-09T07:31:23+00:00" }, { "name": "sebastian/cli-parser", From 192acddccbfd847fabe4852a5db4ebe46f80b37d Mon Sep 17 00:00:00 2001 From: Faizan Shaikh Date: Wed, 21 Dec 2022 18:47:25 +0530 Subject: [PATCH 19/27] AC-7495:Return support of PHP 7 in Magento Coding Standard --- .github/workflows/php.yml | 3 +++ composer.json | 4 ++-- composer.lock | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f4472119..e579cf3c 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,6 +13,9 @@ jobs: fail-fast: false matrix: php-version: + - "7.3" + - "7.4" + - "8.0" - "8.1" dependencies: - "lowest" diff --git a/composer.json b/composer.json index c9f23250..2e798fd2 100644 --- a/composer.json +++ b/composer.json @@ -6,9 +6,9 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "28", + "version": "29", "require": { - "php": "^8.1||^8.2", + "php": ">=7.3", "webonyx/graphql-php": "^14.9", "ext-simplexml": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index 60a5c8da..d814ed12 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": "de9d991dbdaf4c3b0df44666b8600182", + "content-hash": "0d11ac46430aae72ed7ed45f94251944", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -2045,10 +2045,10 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.1||^8.2", + "php": ">=7.3", "ext-simplexml": "*", "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 196e86411e23b9f7e275061f420a904285c15f26 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 10 Jan 2023 18:15:11 +0530 Subject: [PATCH 20/27] AC-7563::Jenkin build is not executing for PHP8.2, update the latest package webonyx/graphql-php --- composer.json | 2 +- composer.lock | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/composer.json b/composer.json index c9f23250..c24c77ab 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "version": "28", "require": { "php": "^8.1||^8.2", - "webonyx/graphql-php": "^14.9", + "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", diff --git a/composer.lock b/composer.lock index 60a5c8da..03207ea3 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": "de9d991dbdaf4c3b0df44666b8600182", + "content-hash": "62c9470a9f67101db2fc8b5bf86926cd", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -242,37 +242,41 @@ }, { "name": "webonyx/graphql-php", - "version": "v14.11.8", + "version": "v15.0.0", "source": { "type": "git", "url": "https://github.com/webonyx/graphql-php.git", - "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3" + "reference": "dc754edf765479644a82d96105bd2979530d7f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/04a48693acd785330eefd3b0e4fa67df8dfee7c3", - "reference": "04a48693acd785330eefd3b0e4fa67df8dfee7c3", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/dc754edf765479644a82d96105bd2979530d7f8d", + "reference": "dc754edf765479644a82d96105bd2979530d7f8d", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "php": "^7.1 || ^8" + "php": "^7.4 || ^8" }, "require-dev": { - "amphp/amp": "^2.3", - "doctrine/coding-standard": "^6.0", - "nyholm/psr7": "^1.2", + "amphp/amp": "^2.6", + "dms/phpunit-arraysubset-asserts": "^0.4", + "ergebnis/composer-normalize": "^2.28", + "mll-lab/php-cs-fixer-config": "^4.4", + "nyholm/psr7": "^1.5", "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "0.12.82", - "phpstan/phpstan-phpunit": "0.12.18", - "phpstan/phpstan-strict-rules": "0.12.9", - "phpunit/phpunit": "^7.2 || ^8.5", - "psr/http-message": "^1.0", - "react/promise": "2.*", - "simpod/php-coveralls-mirror": "^3.0", - "squizlabs/php_codesniffer": "3.5.4" + "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", + "react/http": "^1.6", + "react/promise": "^2.9", + "symfony/polyfill-php81": "^1.23", + "symfony/var-exporter": "^5 || ^6", + "thecodingmachine/safe": "^1.3" }, "suggest": { "psr/http-message": "To use standard GraphQL server", @@ -296,7 +300,7 @@ ], "support": { "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v14.11.8" + "source": "https://github.com/webonyx/graphql-php/tree/v15.0.0" }, "funding": [ { @@ -304,7 +308,7 @@ "type": "open_collective" } ], - "time": "2022-09-21T15:35:03+00:00" + "time": "2023-01-06T12:18:04+00:00" } ], "packages-dev": [ @@ -2050,5 +2054,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 2466e633462a7eeec3a16c08b321c43e09ca7b23 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Tue, 10 Jan 2023 18:20:26 +0530 Subject: [PATCH 21/27] AC-7563::Jenkin build is not executing for PHP8.2, update the latest package webonyx/graphql-php --- composer.json | 4 ++-- composer.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 2e798fd2..e617088e 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "29", + "version": "30", "require": { "php": ">=7.3", - "webonyx/graphql-php": "^14.9", + "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", diff --git a/composer.lock b/composer.lock index 2bfb420b..d9c0b456 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": "0d11ac46430aae72ed7ed45f94251944", + "content-hash": "8e87082adb0be1ca0902965b4afe98f6", "packages": [ { "name": "phpcompatibility/php-compatibility", From 092b0b8e54083497fe28562064d7c84acce55da8 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Wed, 11 Jan 2023 15:03:02 +0530 Subject: [PATCH 22/27] AC-7563::Jenkin build is not executing for PHP8.2, update the latest package webonyx/graphql-php --- .github/workflows/php.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e579cf3c..ac9fc0a0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,7 +13,6 @@ jobs: fail-fast: false matrix: php-version: - - "7.3" - "7.4" - "8.0" - "8.1" From 98baf779b32d1b3c1e1e09fb78b12fa4c437e002 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Wed, 11 Jan 2023 16:10:29 +0530 Subject: [PATCH 23/27] AC-7563::Jenkin build is not executing for PHP8.2, update the latest package webonyx/graphql-php --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index e617088e..a277cf3a 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "type": "phpcodesniffer-standard", "version": "30", "require": { - "php": ">=7.3", + "php": ">=7.4", "webonyx/graphql-php": "^15.0", "ext-simplexml": "*", "ext-dom": "*", diff --git a/composer.lock b/composer.lock index d9c0b456..11f55459 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": "8e87082adb0be1ca0902965b4afe98f6", + "content-hash": "cfdb4177ef4747a5a6b83942ab05d65d", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -2049,7 +2049,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.3", + "php": ">=7.4", "ext-simplexml": "*", "ext-dom": "*" }, From 2ea3c393903fcbc1db310d96e0aff4bba540c4a3 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Tue, 17 Jan 2023 21:41:29 +1300 Subject: [PATCH 24/27] Allow class names with 'admin__' prefix --- Magento2/Sniffs/Less/ClassNamingSniff.php | 5 +- Magento2/Tests/Less/ClassNamingUnitTest.less | 5 + composer.json | 3 +- composer.lock | 121 ++++++++++++++++++- 4 files changed, 130 insertions(+), 4 deletions(-) diff --git a/Magento2/Sniffs/Less/ClassNamingSniff.php b/Magento2/Sniffs/Less/ClassNamingSniff.php index e684172b..babd0653 100644 --- a/Magento2/Sniffs/Less/ClassNamingSniff.php +++ b/Magento2/Sniffs/Less/ClassNamingSniff.php @@ -66,7 +66,10 @@ public function process(File $phpcsFile, $stackPtr) [implode("", $matches[0])] ); } - if (strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false) { + + if (strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false + && !str_starts_with($className, 'admin__') + ) { $phpcsFile->addError( 'CSS class names should be separated with "-" (dash) instead of "_" (underscore)', $stackPtr, diff --git a/Magento2/Tests/Less/ClassNamingUnitTest.less b/Magento2/Tests/Less/ClassNamingUnitTest.less index ba60c205..bbb29cde 100644 --- a/Magento2/Tests/Less/ClassNamingUnitTest.less +++ b/Magento2/Tests/Less/ClassNamingUnitTest.less @@ -30,3 +30,8 @@ .category-title { background: green; } + +// @see https://github.com/magento/magento-coding-standard/issues/409 +.admin__allowed { + background: green; +} diff --git a/composer.json b/composer.json index a277cf3a..49b3f7e2 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.14.8" + "rector/rector": "^0.14.8", + "symfony/polyfill": "^1.16" }, "require-dev": { "phpunit/phpunit": "^9.5.8" diff --git a/composer.lock b/composer.lock index 11f55459..b4a64057 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": "cfdb4177ef4747a5a6b83942ab05d65d", + "content-hash": "0c1e598f16594c56f36b7da4e389d3f9", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -240,6 +240,123 @@ }, "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", @@ -2054,5 +2171,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } From d16895a56b57e1f12b54e54289a79de1c592097f Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Date: Mon, 30 Jan 2023 13:24:26 +0530 Subject: [PATCH 25/27] AC-7822:Phpstan dependency should not be limited to a specific version, updated rector/rector with latest version --- composer.json | 4 ++-- composer.lock | 29 ++++++++++++++--------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index a277cf3a..355a66f6 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "AFL-3.0" ], "type": "phpcodesniffer-standard", - "version": "30", + "version": "31", "require": { "php": ">=7.4", "webonyx/graphql-php": "^15.0", @@ -14,7 +14,7 @@ "ext-dom": "*", "phpcompatibility/php-compatibility": "^9.3", "squizlabs/php_codesniffer": "^3.6.1", - "rector/rector": "^0.14.8" + "rector/rector": "^0.15.10" }, "require-dev": { "phpunit/phpunit": "^9.5.8" diff --git a/composer.lock b/composer.lock index 11f55459..f2880864 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": "cfdb4177ef4747a5a6b83942ab05d65d", + "content-hash": "a1016f46104814a16b090a61a5c2ca2a", "packages": [ { "name": "phpcompatibility/php-compatibility", @@ -70,16 +70,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.9.3", + "version": "1.9.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c" + "reference": "e5fcc96289cf737304286a9b505fbed091f02e58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", - "reference": "709999b91448d4f2bb07daffffedc889b33e461c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58", + "reference": "e5fcc96289cf737304286a9b505fbed091f02e58", "shasum": "" }, "require": { @@ -109,7 +109,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.9.3" + "source": "https://github.com/phpstan/phpstan/tree/1.9.14" }, "funding": [ { @@ -125,31 +125,30 @@ "type": "tidelift" } ], - "time": "2022-12-13T10:28:10+00:00" + "time": "2023-01-19T10:47:09+00:00" }, { "name": "rector/rector", - "version": "0.14.8", + "version": "0.15.10", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "46ee9a173a2b2645ca92a75ffc17460139fa226e" + "reference": "000bfb6f7974449399f39e1a210458395b75c887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/46ee9a173a2b2645ca92a75ffc17460139fa226e", - "reference": "46ee9a173a2b2645ca92a75ffc17460139fa226e", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/000bfb6f7974449399f39e1a210458395b75c887", + "reference": "000bfb6f7974449399f39e1a210458395b75c887", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.9.0" + "phpstan/phpstan": "^1.9.7" }, "conflict": { "rector/rector-doctrine": "*", "rector/rector-downgrade-php": "*", "rector/rector-php-parser": "*", - "rector/rector-phpoffice": "*", "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, @@ -174,7 +173,7 @@ "description": "Instant Upgrade and Automated Refactoring of any PHP code", "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.14.8" + "source": "https://github.com/rectorphp/rector/tree/0.15.10" }, "funding": [ { @@ -182,7 +181,7 @@ "type": "github" } ], - "time": "2022-11-14T14:09:49+00:00" + "time": "2023-01-21T14:30:16+00:00" }, { "name": "squizlabs/php_codesniffer", From 255e0290f9b50cae5e1efc5973bd1f7df200489f Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 16 Feb 2023 12:01:10 +0000 Subject: [PATCH 26/27] Add another test case --- Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc | 2 ++ Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.php | 1 + 2 files changed, 3 insertions(+) diff --git a/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc index b254ebc0..14f7ba1e 100644 --- a/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc +++ b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc @@ -3,3 +3,5 @@ + + diff --git a/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.php b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.php index 159ddedb..c7a68fe5 100644 --- a/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.php +++ b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.php @@ -24,6 +24,7 @@ public function getWarningList() { return [ 5 => 1, + 7 => 1, ]; } } From 4612aa3600a8bd0b46cf1bacd8fd9ed45c53e8fe Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Thu, 16 Feb 2023 12:02:29 +0000 Subject: [PATCH 27/27] Auto-fix short echo syntax --- Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php | 21 ++++++++++++++++++- .../PHP/ShortEchoSyntaxUnitTest.inc.fixed | 7 +++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc.fixed diff --git a/Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php b/Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php index 946bb273..da1aa279 100644 --- a/Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php +++ b/Magento2/Sniffs/PHP/ShortEchoSyntaxSniff.php @@ -37,11 +37,30 @@ public function process(File $phpcsFile, $stackPtr) $nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true); if ($tokens[$nextToken]['code'] == T_ECHO) { - $phpcsFile->addWarning( + $fix = $phpcsFile->addFixableWarning( 'Short echo tag syntax must be used; expected "fixer->beginChangeset(); + + if (($nextToken - $stackPtr) === 1) { + $phpcsFile->fixer->replaceToken($stackPtr, 'fixer->replaceToken($stackPtr, 'fixer->replaceToken($i, ''); + } + } + + $phpcsFile->fixer->replaceToken($nextToken, ''); + $phpcsFile->fixer->endChangeset(); + } } } } diff --git a/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc.fixed b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc.fixed new file mode 100644 index 00000000..a3073e65 --- /dev/null +++ b/Magento2/Tests/PHP/ShortEchoSyntaxUnitTest.inc.fixed @@ -0,0 +1,7 @@ + + + + + + +