From cbd6fd5fd29a1f094d689291152ba1ea295bc0bc Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 28 Oct 2023 23:30:18 +0200 Subject: [PATCH 1/3] Tests: remove unreachable code `break` after a `return` statement is redundant. As a side-note: I did have to chuckle when I saw that the `NonExecutableCode` test file also included this :joy: --- .../Tests/Classes/DuplicateClassNameUnitTest.php | 9 ++++----- .../Generic/Tests/Files/InlineHTMLUnitTest.php | 7 +++---- .../Generic/Tests/Files/LineLengthUnitTest.php | 12 +++++------- .../MultipleStatementAlignmentUnitTest.php | 5 ++--- .../PHP/CharacterBeforePHPOpeningTagUnitTest.php | 3 +-- .../Generic/Tests/PHP/ClosingPHPTagUnitTest.php | 4 ++-- .../Generic/Tests/PHP/LowerCaseConstantUnitTest.php | 5 ++--- .../Tests/PHP/RequireStrictTypesUnitTest.php | 1 - src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php | 3 +-- .../Strings/UnnecessaryStringConcatUnitTest.php | 5 ++--- .../WhiteSpace/DisallowSpaceIndentUnitTest.php | 9 ++++----- .../LongConditionClosingCommentUnitTest.php | 5 ++--- .../Tests/Formatting/OperatorBracketUnitTest.php | 5 ++--- .../Operators/ComparisonOperatorUsageUnitTest.php | 5 ++--- .../Squiz/Tests/PHP/CommentedOutCodeUnitTest.php | 5 ++--- .../Squiz/Tests/PHP/DisallowInlineIfUnitTest.php | 5 ++--- .../PHP/DisallowSizeFunctionsInLoopsUnitTest.php | 5 ++--- .../Squiz/Tests/PHP/NonExecutableCodeUnitTest.php | 5 ++--- .../WhiteSpace/ControlStructureSpacingUnitTest.php | 5 ++--- .../FunctionClosingBraceSpaceUnitTest.php | 5 ++--- .../Tests/WhiteSpace/OperatorSpacingUnitTest.php | 5 ++--- .../Tests/WhiteSpace/SemicolonSpacingUnitTest.php | 5 ++--- .../WhiteSpace/SuperfluousWhitespaceUnitTest.php | 13 ++++++------- 23 files changed, 54 insertions(+), 77 deletions(-) diff --git a/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php b/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php index 68982f8686..c0893f988e 100644 --- a/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php +++ b/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.php @@ -50,7 +50,7 @@ public function getWarningList($testFile='') 12 => 1, 13 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.2.inc': return [ 2 => 1, @@ -58,19 +58,18 @@ public function getWarningList($testFile='') 4 => 1, 5 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.5.inc': return [ 3 => 1, 7 => 1, ]; - break; + case 'DuplicateClassNameUnitTest.6.inc': return [10 => 1]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php b/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php index 4403e5d525..a34208dcb2 100644 --- a/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php +++ b/src/Standards/Generic/Tests/Files/InlineHTMLUnitTest.php @@ -30,16 +30,15 @@ public function getErrorList($testFile='') switch ($testFile) { case 'InlineHTMLUnitTest.3.inc': return [4 => 1]; - break; + case 'InlineHTMLUnitTest.4.inc': return [1 => 1]; - break; + case 'InlineHTMLUnitTest.7.inc': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php b/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php index 4414753a1f..061a36f4e3 100644 --- a/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php +++ b/src/Standards/Generic/Tests/Files/LineLengthUnitTest.php @@ -50,14 +50,13 @@ public function getErrorList($testFile='') 45 => 1, 82 => 1, ]; - break; + case 'LineLengthUnitTest.2.inc': case 'LineLengthUnitTest.3.inc': return [7 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() @@ -89,20 +88,19 @@ public function getWarningList($testFile='') 75 => 1, 84 => 1, ]; - break; + case 'LineLengthUnitTest.2.inc': case 'LineLengthUnitTest.3.inc': return [6 => 1]; - break; + case 'LineLengthUnitTest.4.inc': return [ 10 => 1, 14 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php index 23f2f9a780..170e68437e 100644 --- a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php +++ b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php @@ -122,7 +122,7 @@ public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc 499 => 1, 500 => 1, ]; - break; + case 'MultipleStatementAlignmentUnitTest.js': return [ 11 => 1, @@ -154,10 +154,9 @@ public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc 114 => 1, 117 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php b/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php index 11f4f14dad..bc6be6d365 100644 --- a/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/CharacterBeforePHPOpeningTagUnitTest.php @@ -30,10 +30,9 @@ public function getErrorList($testFile='') switch ($testFile) { case 'CharacterBeforePHPOpeningTagUnitTest.1.inc': return [2 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php index 9c567b7bad..a86f053939 100644 --- a/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/ClosingPHPTagUnitTest.php @@ -30,12 +30,12 @@ public function getErrorList($testFile='') switch ($testFile) { case 'ClosingPHPTagUnitTest.1.inc': return [9 => 1]; + case 'ClosingPHPTagUnitTest.2.inc': return [5 => 1]; - break; + default: return []; - break; } }//end getErrorList() diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php index 2fb2d6f6dc..21efbb9574 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php @@ -52,7 +52,7 @@ public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') 95 => 1, 100 => 2, ]; - break; + case 'LowerCaseConstantUnitTest.js': return [ 2 => 1, @@ -64,10 +64,9 @@ public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') 13 => 1, 14 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php b/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php index 4ab417cd02..9121cf6e04 100644 --- a/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php @@ -30,7 +30,6 @@ public function getErrorList($testFile='') switch ($testFile) { case 'RequireStrictTypesUnitTest.1.inc': return []; - break; } return [1 => 1]; diff --git a/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php b/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php index 98d205ce43..da65d47722 100644 --- a/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php @@ -32,10 +32,9 @@ public function getErrorList($testFile='') case 'SyntaxUnitTest.1.inc': case 'SyntaxUnitTest.2.inc': return [3 => 1]; - break; + default: return []; - break; } }//end getErrorList() diff --git a/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php b/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php index 6a9284822c..9485d8fe25 100644 --- a/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php +++ b/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php @@ -37,7 +37,7 @@ public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') 19 => 1, 20 => 1, ]; - break; + case 'UnnecessaryStringConcatUnitTest.js': return [ 1 => 1, @@ -46,10 +46,9 @@ public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') 14 => 1, 15 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php index f915cf4aa9..79eda5fcd8 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php @@ -85,7 +85,7 @@ public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') 117 => 1, 118 => 1, ]; - break; + case 'DisallowSpaceIndentUnitTest.3.inc': return [ 2 => 1, @@ -96,16 +96,15 @@ public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') 14 => 1, 15 => 1, ]; - break; + case 'DisallowSpaceIndentUnitTest.js': return [3 => 1]; - break; + case 'DisallowSpaceIndentUnitTest.css': return [2 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php index 5b61612c50..a4382c278d 100644 --- a/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php @@ -60,7 +60,7 @@ public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc' 1008 => 1, 1032 => 1, ]; - break; + case 'LongConditionClosingCommentUnitTest.js': return [ 47 => 1, @@ -76,10 +76,9 @@ public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc' 439 => 1, 444 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php index 4f04a6ebd0..4d04c53560 100644 --- a/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php +++ b/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php @@ -73,7 +73,7 @@ public function getErrorList($testFile='OperatorBracketUnitTest.inc') 193 => 1, 194 => 2, ]; - break; + case 'OperatorBracketUnitTest.js': return [ 5 => 1, @@ -90,10 +90,9 @@ public function getErrorList($testFile='OperatorBracketUnitTest.inc') 63 => 1, 108 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php index 5618a7fc0c..25a4f4fa81 100644 --- a/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php +++ b/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php @@ -59,7 +59,7 @@ public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') 131 => 1, 135 => 1, ]; - break; + case 'ComparisonOperatorUsageUnitTest.js': return [ 5 => 1, @@ -74,10 +74,9 @@ public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') 67 => 1, 71 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php index 36c556d8c2..f086ec00a1 100644 --- a/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php @@ -58,16 +58,15 @@ public function getWarningList($testFile='CommentedOutCodeUnitTest.inc') 147 => 1, 158 => 1, ]; - break; + case 'CommentedOutCodeUnitTest.css': return [ 7 => 1, 16 => 1, ]; - break; + default: return []; - break; }//end switch }//end getWarningList() diff --git a/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php index 27083ce2c1..6e736d2366 100644 --- a/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php @@ -33,13 +33,12 @@ public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') 8 => 1, 18 => 1, ]; - break; + case 'DisallowInlineIfUnitTest.js': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php index 21260ad718..72e1f1a792 100644 --- a/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php @@ -43,13 +43,12 @@ public function getErrorList($testFile='DisallowSizeFunctionsInLoopsUnitTest.inc 44 => 1, 46 => 1, ]; - break; + case 'DisallowSizeFunctionsInLoopsUnitTest.js': return [1 => 1]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php index 40e4068e42..a9b42e2e29 100644 --- a/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/NonExecutableCodeUnitTest.php @@ -83,7 +83,7 @@ public function getWarningList($testFile='') 391 => 1, 396 => 1, ]; - break; + case 'NonExecutableCodeUnitTest.2.inc': return [ 7 => 1, @@ -97,7 +97,7 @@ public function getWarningList($testFile='') 70 => 2, 71 => 2, ]; - break; + case 'NonExecutableCodeUnitTest.3.inc': return [ 27 => 1, @@ -108,7 +108,6 @@ public function getWarningList($testFile='') ]; default: return []; - break; }//end switch }//end getWarningList() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php index ac3f5d6ff5..cd31d7600b 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php @@ -61,7 +61,7 @@ public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') 261 => 1, 262 => 1, ]; - break; + case 'ControlStructureSpacingUnitTest.js': return [ 3 => 1, @@ -76,10 +76,9 @@ public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') 74 => 2, 75 => 2, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php index 2e18f875b3..10f0ea7ddc 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php @@ -37,7 +37,7 @@ public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') 31 => 1, 39 => 1, ]; - break; + case 'FunctionClosingBraceSpaceUnitTest.js': return [ 13 => 1, @@ -49,10 +49,9 @@ public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') 84 => 1, 128 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php index 8e8ad98d08..cd2bcd2d8a 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php @@ -100,7 +100,7 @@ public function getErrorList($testFile='OperatorSpacingUnitTest.inc') 266 => 2, 271 => 2, ]; - break; + case 'OperatorSpacingUnitTest.js': return [ 4 => 1, @@ -143,10 +143,9 @@ public function getErrorList($testFile='OperatorSpacingUnitTest.inc') 100 => 1, 103 => 2, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php index 72196f8e78..bee6a05b64 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php @@ -43,7 +43,7 @@ public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') 30 => 2, 36 => 1, ]; - break; + case 'SemicolonSpacingUnitTest.js': return [ 3 => 1, @@ -56,10 +56,9 @@ public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') 22 => 1, 25 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() diff --git a/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php index 2f1ead2307..c8904b431f 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php @@ -44,26 +44,26 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') 65 => 1, 73 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.2.inc': return [ 2 => 1, 8 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.3.inc': return [ 6 => 1, 10 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.4.inc': case 'SuperfluousWhitespaceUnitTest.5.inc': return [ 1 => 1, 4 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.1.js': return [ 1 => 1, @@ -77,7 +77,7 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') 38 => 1, 56 => 1, ]; - break; + case 'SuperfluousWhitespaceUnitTest.1.css': return [ 1 => 1, @@ -86,10 +86,9 @@ public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') 11 => 1, 32 => 1, ]; - break; + default: return []; - break; }//end switch }//end getErrorList() From 8b407f79da4243ce48146c201bd935f01ccf4162 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 29 Oct 2023 18:30:35 +0100 Subject: [PATCH 2/3] Various: remove some redundant return statements ... when the `return` is at the end of the function without a value, and therefore not needed. --- src/Sniffs/AbstractScopeSniff.php | 2 -- src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php | 2 -- tests/Standards/AbstractSniffUnitTest.php | 1 - 3 files changed, 5 deletions(-) diff --git a/src/Sniffs/AbstractScopeSniff.php b/src/Sniffs/AbstractScopeSniff.php index 70d8720a1e..965310cbd5 100644 --- a/src/Sniffs/AbstractScopeSniff.php +++ b/src/Sniffs/AbstractScopeSniff.php @@ -148,8 +148,6 @@ final public function process(File $phpcsFile, $stackPtr) return min($skipTokens); } - return; - }//end process() diff --git a/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php index 0ece1acad2..f9cf4e45e7 100644 --- a/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php +++ b/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php @@ -212,8 +212,6 @@ protected function processMemberVar(File $phpcsFile, $stackPtr) return $endOfStatement; } - return; - }//end processMemberVar() diff --git a/tests/Standards/AbstractSniffUnitTest.php b/tests/Standards/AbstractSniffUnitTest.php index c050a0c2af..62c41e5b17 100644 --- a/tests/Standards/AbstractSniffUnitTest.php +++ b/tests/Standards/AbstractSniffUnitTest.php @@ -431,7 +431,6 @@ public function generateFailureMessages(LocalFile $file) */ public function setCliValues($filename, $config) { - return; }//end setCliValues() From 91cd66a35fddbf60fdade781670d4a600fab49f4 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 29 Oct 2023 18:32:16 +0100 Subject: [PATCH 3/3] PHPCS: add the `Squiz.PHP.NonExecutableCode` sniff to the ruleset ... which is used for PHPCS itself. --- phpcs.xml.dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3c54610094..17e2000ade 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -142,6 +142,11 @@ error + + + error + + tests/bootstrap\.php