From 8a1e0c2d776ea821a216b3aa3668ab35ccd10593 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 15 Dec 2023 10:10:17 -0300 Subject: [PATCH 1/3] Remove unused first parameter from getErrorList() and getWarningList() This commit removes the first paramter from getErrorList() and getWarningList() when the parameter is not used inside the method. --- src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php | 8 ++------ src/Standards/Generic/Tests/Commenting/TodoUnitTest.php | 8 ++------ .../Tests/Objects/CreateWidgetTypeCallbackUnitTest.php | 4 +--- .../Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php | 4 +--- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php b/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php index e89b2298e9..90ee54c499 100644 --- a/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php +++ b/src/Standards/Generic/Tests/Commenting/FixmeUnitTest.php @@ -27,11 +27,9 @@ class FixmeUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getErrorList($testFile='FixmeUnitTest.inc') + public function getErrorList() { return [ 3 => 1, @@ -53,11 +51,9 @@ public function getErrorList($testFile='FixmeUnitTest.inc') * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getWarningList($testFile='FixmeUnitTest.inc') + public function getWarningList() { return []; diff --git a/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php b/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php index 30de38383d..d3300fb15c 100644 --- a/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php +++ b/src/Standards/Generic/Tests/Commenting/TodoUnitTest.php @@ -26,11 +26,9 @@ class TodoUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getErrorList($testFile='TodoUnitTest.inc') + public function getErrorList() { return []; @@ -43,11 +41,9 @@ public function getErrorList($testFile='TodoUnitTest.inc') * The key of the array should represent the line number and the value * should represent the number of warnings that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getWarningList($testFile='TodoUnitTest.inc') + public function getWarningList() { return [ 3 => 1, diff --git a/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php b/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php index 7ae3342f54..55b93375a9 100644 --- a/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php +++ b/src/Standards/MySource/Tests/Objects/CreateWidgetTypeCallbackUnitTest.php @@ -26,11 +26,9 @@ class CreateWidgetTypeCallbackUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getErrorList($testFile='CreateWidgetTypeCallbackUnitTest.js') + public function getErrorList() { return [ 18 => 1, diff --git a/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php index 660b7ef23c..1c985ef8cd 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/LogicalOperatorSpacingUnitTest.php @@ -26,11 +26,9 @@ class LogicalOperatorSpacingUnitTest extends AbstractSniffUnitTest * The key of the array should represent the line number and the value * should represent the number of errors that should occur on that line. * - * @param string $testFile The name of the file being tested. - * * @return array */ - public function getErrorList($testFile='LogicalOperatorSpacingUnitTest.inc') + public function getErrorList() { return [ 4 => 2, From 4231f693e725077060df2d5acd843a6f22e5a3f7 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 15 Dec 2023 10:13:28 -0300 Subject: [PATCH 2/3] Replace default value of first parameter in getWarningList() with '' Replacing the default value with an empty string. Per Juliette's comment (https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/163#discussion_r1426775588) there are three reasons why we want to do that: - The default value has no value in practice. It is an optional argument which is not enforced via the abstract functions, but is passed in all cases, so the default is never used in practice. - Setting the default value as file 1 also has an assumption implied, while IMO assumptions have no place in a test suite. - Maintainability - one less thing to have to keep in sync and to guard against typos --- .../Tests/Formatting/MultipleStatementAlignmentUnitTest.php | 2 +- src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php | 2 +- .../Tests/ControlStructures/ForLoopDeclarationUnitTest.php | 2 +- .../Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php | 2 +- src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php index ea27e98dbf..b27a7b0306 100644 --- a/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php +++ b/src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php @@ -45,7 +45,7 @@ public function getErrorList() * * @return array */ - public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc') + public function getWarningList($testFile='') { switch ($testFile) { case 'MultipleStatementAlignmentUnitTest.inc': diff --git a/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php b/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php index 3b55cdc3d9..6d62b9c12f 100644 --- a/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php +++ b/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php @@ -74,7 +74,7 @@ public function getErrorList($testFile='FileCommentUnitTest.inc') * * @return array */ - public function getWarningList($testFile='FileCommentUnitTest.inc') + public function getWarningList($testFile='') { switch ($testFile) { case 'FileCommentUnitTest.1.inc': diff --git a/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php index d7701c1310..efb1f1e338 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php @@ -118,7 +118,7 @@ public function getErrorList($testFile='ForLoopDeclarationUnitTest.inc') * * @return array */ - public function getWarningList($testFile='ForLoopDeclarationUnitTest.inc') + public function getWarningList($testFile='') { switch ($testFile) { case 'ForLoopDeclarationUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php index 1bd84621f3..bb39572654 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php @@ -143,7 +143,7 @@ public function getErrorList($testFile='SwitchDeclarationUnitTest.inc') * * @return array */ - public function getWarningList($testFile='SwitchDeclarationUnitTest.inc') + public function getWarningList($testFile='') { if ($testFile === 'SwitchDeclarationUnitTest.js') { return [273 => 1]; diff --git a/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php b/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php index 34b706b22b..148d13882f 100644 --- a/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php @@ -45,7 +45,7 @@ public function getErrorList() * * @return array */ - public function getWarningList($testFile='CommentedOutCodeUnitTest.inc') + public function getWarningList($testFile='') { switch ($testFile) { case 'CommentedOutCodeUnitTest.inc': From e3d31005eeacc144f7b9df7d28555b7632741d20 Mon Sep 17 00:00:00 2001 From: Rodrigo Primo Date: Fri, 15 Dec 2023 10:22:13 -0300 Subject: [PATCH 3/3] Replace default value of first parameter in getErrorList() with '' Replacing the default value with an empty string. Per Juliette's comment (https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/163#discussion_r1426775588) there are three reasons why we want to do that: - The default value has no value in practice. It is an optional argument which is not enforced via the abstract functions, but is passed in all cases, so the default is never used in practice. - Setting the default value as file 1 also has an assumption implied, while IMO assumptions have no place in a test suite. - Maintainability - one less thing to have to keep in sync and to guard against typos --- .../Tests/ControlStructures/InlineControlStructureUnitTest.php | 2 +- src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php | 2 +- .../Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php | 2 +- .../Generic/Tests/VersionControl/GitMergeConflictUnitTest.php | 2 +- .../Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php | 2 +- .../Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php | 2 +- src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php | 2 +- src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php | 2 +- src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php | 2 +- src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php | 2 +- src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php | 2 +- .../PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php | 2 +- .../PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php | 2 +- .../PEAR/Tests/Functions/FunctionDeclarationUnitTest.php | 2 +- .../Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php | 2 +- src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php | 2 +- src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php | 2 +- .../Tests/Commenting/LongConditionClosingCommentUnitTest.php | 2 +- .../Squiz/Tests/Commenting/PostStatementCommentUnitTest.php | 2 +- .../Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php | 2 +- .../Tests/ControlStructures/ForLoopDeclarationUnitTest.php | 2 +- .../Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php | 2 +- .../Squiz/Tests/Formatting/OperatorBracketUnitTest.php | 2 +- .../Tests/Functions/MultiLineFunctionDeclarationUnitTest.php | 2 +- .../Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php | 2 +- .../Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php | 2 +- src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php | 2 +- .../Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php | 2 +- .../Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php | 2 +- .../Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php | 2 +- .../Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php | 2 +- .../Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php | 2 +- .../Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php | 2 +- .../Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php b/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php index bc61577fb7..af4d43ea50 100644 --- a/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php +++ b/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php @@ -30,7 +30,7 @@ class InlineControlStructureUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='InlineControlStructureUnitTest.1.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'InlineControlStructureUnitTest.1.inc': diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php index f047e2609b..fac155c459 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.php @@ -30,7 +30,7 @@ class LowerCaseConstantUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='LowerCaseConstantUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'LowerCaseConstantUnitTest.inc': diff --git a/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php b/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php index 25b983d6b5..ce08934bdf 100644 --- a/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php +++ b/src/Standards/Generic/Tests/Strings/UnnecessaryStringConcatUnitTest.php @@ -30,7 +30,7 @@ class UnnecessaryStringConcatUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='UnnecessaryStringConcatUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'UnnecessaryStringConcatUnitTest.inc': diff --git a/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php b/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php index 1a71c85d58..f67518258d 100644 --- a/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php +++ b/src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php @@ -30,7 +30,7 @@ class GitMergeConflictUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'GitMergeConflictUnitTest.1.inc': diff --git a/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php index d745785b28..799568a1f7 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php @@ -49,7 +49,7 @@ public function setCliValues($testFile, $config) * * @return array */ - public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'DisallowSpaceIndentUnitTest.1.inc': diff --git a/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php index 77f20ee397..ce6e114da6 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/IncrementDecrementSpacingUnitTest.php @@ -30,7 +30,7 @@ class IncrementDecrementSpacingUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='IncrementDecrementSpacingUnitTest.inc') + public function getErrorList($testFile='') { $errors = [ 5 => 1, diff --git a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php index 729bea1925..feb4fd67c0 100644 --- a/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php +++ b/src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php @@ -50,7 +50,7 @@ public function setCliValues($testFile, $config) * * @return array */ - public function getErrorList($testFile='ScopeIndentUnitTest.inc') + public function getErrorList($testFile='') { if ($testFile === 'ScopeIndentUnitTest.1.js') { return [ diff --git a/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php b/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php index 47ce7c1a12..3a88a0ecdf 100644 --- a/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php +++ b/src/Standards/MySource/Tests/Debug/FirebugConsoleUnitTest.php @@ -30,7 +30,7 @@ class FirebugConsoleUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FirebugConsoleUnitTest.js') + public function getErrorList($testFile='') { if ($testFile !== 'FirebugConsoleUnitTest.js') { return []; diff --git a/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php b/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php index be2eacf433..4b056a7faa 100644 --- a/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php +++ b/src/Standards/MySource/Tests/Objects/AssignThisUnitTest.php @@ -30,7 +30,7 @@ class AssignThisUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='AssignThisUnitTest.js') + public function getErrorList($testFile='') { if ($testFile !== 'AssignThisUnitTest.js') { return []; diff --git a/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php b/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php index dcb397fdae..a2c43dce03 100644 --- a/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php +++ b/src/Standards/MySource/Tests/Strings/JoinStringsUnitTest.php @@ -30,7 +30,7 @@ class JoinStringsUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='JoinStringsUnitTest.js') + public function getErrorList($testFile='') { if ($testFile !== 'JoinStringsUnitTest.js') { return []; diff --git a/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php b/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php index 6d62b9c12f..52bcd5872e 100644 --- a/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php +++ b/src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php @@ -30,7 +30,7 @@ class FileCommentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FileCommentUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'FileCommentUnitTest.1.inc': diff --git a/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php b/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php index 821c7bfbee..aadaea9490 100644 --- a/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php +++ b/src/Standards/PEAR/Tests/ControlStructures/MultiLineConditionUnitTest.php @@ -30,7 +30,7 @@ class MultiLineConditionUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='MultiLineConditionUnitTest.inc') + public function getErrorList($testFile='') { $errors = [ 21 => 1, diff --git a/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php b/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php index 38eff588ba..f6d456ac04 100644 --- a/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php +++ b/src/Standards/PEAR/Tests/Functions/FunctionCallSignatureUnitTest.php @@ -30,7 +30,7 @@ class FunctionCallSignatureUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FunctionCallSignatureUnitTest.inc') + public function getErrorList($testFile='') { if ($testFile === 'FunctionCallSignatureUnitTest.js') { return [ diff --git a/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php b/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php index 828c7da04c..43cffff080 100644 --- a/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php +++ b/src/Standards/PEAR/Tests/Functions/FunctionDeclarationUnitTest.php @@ -30,7 +30,7 @@ class FunctionDeclarationUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FunctionDeclarationUnitTest.inc') + public function getErrorList($testFile='') { if ($testFile === 'FunctionDeclarationUnitTest.inc') { $errors = [ diff --git a/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php index 4d735f4ca1..6eab274482 100644 --- a/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php @@ -30,7 +30,7 @@ class DocCommentAlignmentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='DocCommentAlignmentUnitTest.inc') + public function getErrorList($testFile='') { $errors = [ 3 => 1, diff --git a/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php index ab93fc89a2..b7b686d73b 100644 --- a/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.php @@ -30,7 +30,7 @@ class FileCommentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FileCommentUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'FileCommentUnitTest.1.inc': diff --git a/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php index 8be723a4b6..dbaccb2cbe 100644 --- a/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/InlineCommentUnitTest.php @@ -30,7 +30,7 @@ class InlineCommentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='InlineCommentUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'InlineCommentUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php index fae751d4c2..a24a68a266 100644 --- a/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/LongConditionClosingCommentUnitTest.php @@ -30,7 +30,7 @@ class LongConditionClosingCommentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='LongConditionClosingCommentUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'LongConditionClosingCommentUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php b/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php index acfc8fc954..7d7f270ab1 100644 --- a/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php +++ b/src/Standards/Squiz/Tests/Commenting/PostStatementCommentUnitTest.php @@ -30,7 +30,7 @@ class PostStatementCommentUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='PostStatementCommentUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'PostStatementCommentUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php index 0ea1354399..3187047c7c 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.php @@ -30,7 +30,7 @@ class ControlSignatureUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='ControlSignatureUnitTest.inc') + public function getErrorList($testFile='') { $errors = [ 7 => 1, diff --git a/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php index efb1f1e338..5ceba29ed6 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php @@ -30,7 +30,7 @@ class ForLoopDeclarationUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='ForLoopDeclarationUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'ForLoopDeclarationUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php b/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php index bb39572654..32f9ce35a5 100644 --- a/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php @@ -30,7 +30,7 @@ class SwitchDeclarationUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='SwitchDeclarationUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'SwitchDeclarationUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php b/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php index f00cd1574d..ee5af1b9d0 100644 --- a/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php +++ b/src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.php @@ -30,7 +30,7 @@ class OperatorBracketUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='OperatorBracketUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'OperatorBracketUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php index b3a062b50b..1dd5cca225 100644 --- a/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php +++ b/src/Standards/Squiz/Tests/Functions/MultiLineFunctionDeclarationUnitTest.php @@ -30,7 +30,7 @@ class MultiLineFunctionDeclarationUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='MultiLineFunctionDeclarationUnitTest.inc') + public function getErrorList($testFile='') { if ($testFile === 'MultiLineFunctionDeclarationUnitTest.inc') { $errors = [ diff --git a/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php b/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php index bd83fa2415..f3a71f754d 100644 --- a/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php +++ b/src/Standards/Squiz/Tests/Objects/DisallowObjectStringIndexUnitTest.php @@ -30,7 +30,7 @@ class DisallowObjectStringIndexUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='DisallowObjectStringIndexUnitTest.js') + public function getErrorList($testFile='') { if ($testFile !== 'DisallowObjectStringIndexUnitTest.js') { return []; diff --git a/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php b/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php index d0b1d3800e..ffaf905d90 100644 --- a/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php +++ b/src/Standards/Squiz/Tests/Operators/ComparisonOperatorUsageUnitTest.php @@ -30,7 +30,7 @@ class ComparisonOperatorUsageUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='ComparisonOperatorUsageUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'ComparisonOperatorUsageUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php b/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php index d913d2f53f..7e78e97395 100644 --- a/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/DisallowInlineIfUnitTest.php @@ -30,7 +30,7 @@ class DisallowInlineIfUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='DisallowInlineIfUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'DisallowInlineIfUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php b/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php index 424994b20a..8ec0b73c89 100644 --- a/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php +++ b/src/Standards/Squiz/Tests/PHP/DisallowSizeFunctionsInLoopsUnitTest.php @@ -30,7 +30,7 @@ class DisallowSizeFunctionsInLoopsUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='DisallowSizeFunctionsInLoopsUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'DisallowSizeFunctionsInLoopsUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php index 0a81b71657..f3820bba8e 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/ControlStructureSpacingUnitTest.php @@ -30,7 +30,7 @@ class ControlStructureSpacingUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='ControlStructureSpacingUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'ControlStructureSpacingUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php index d2969fc487..90fd2ae2b3 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/FunctionClosingBraceSpaceUnitTest.php @@ -30,7 +30,7 @@ class FunctionClosingBraceSpaceUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FunctionClosingBraceSpaceUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'FunctionClosingBraceSpaceUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php index 55d9432fb9..c5525abba7 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/FunctionOpeningBraceSpaceUnitTest.php @@ -30,7 +30,7 @@ class FunctionOpeningBraceSpaceUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='FunctionOpeningBraceSpaceUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'FunctionOpeningBraceSpaceUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php index 0379d28a97..66b780a74e 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/OperatorSpacingUnitTest.php @@ -30,7 +30,7 @@ class OperatorSpacingUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='OperatorSpacingUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'OperatorSpacingUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php index 9f55e2a302..2f31ffb8bc 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/SemicolonSpacingUnitTest.php @@ -30,7 +30,7 @@ class SemicolonSpacingUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='SemicolonSpacingUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'SemicolonSpacingUnitTest.inc': diff --git a/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php b/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php index cac3416617..7064de21df 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php +++ b/src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php @@ -30,7 +30,7 @@ class SuperfluousWhitespaceUnitTest extends AbstractSniffUnitTest * * @return array */ - public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc') + public function getErrorList($testFile='') { switch ($testFile) { case 'SuperfluousWhitespaceUnitTest.1.inc':