Skip to content

Commit 4231f69

Browse files
committed
Replace default value of first parameter in getWarningList() with ''
Replacing the default value with an empty string. Per Juliette's comment (#163 (comment)) 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
1 parent 8a1e0c2 commit 4231f69

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/Standards/Generic/Tests/Formatting/MultipleStatementAlignmentUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getErrorList()
4545
*
4646
* @return array<int, int>
4747
*/
48-
public function getWarningList($testFile='MultipleStatementAlignmentUnitTest.inc')
48+
public function getWarningList($testFile='')
4949
{
5050
switch ($testFile) {
5151
case 'MultipleStatementAlignmentUnitTest.inc':

src/Standards/PEAR/Tests/Commenting/FileCommentUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getErrorList($testFile='FileCommentUnitTest.inc')
7474
*
7575
* @return array<int, int>
7676
*/
77-
public function getWarningList($testFile='FileCommentUnitTest.inc')
77+
public function getWarningList($testFile='')
7878
{
7979
switch ($testFile) {
8080
case 'FileCommentUnitTest.1.inc':

src/Standards/Squiz/Tests/ControlStructures/ForLoopDeclarationUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function getErrorList($testFile='ForLoopDeclarationUnitTest.inc')
118118
*
119119
* @return array<int, int>
120120
*/
121-
public function getWarningList($testFile='ForLoopDeclarationUnitTest.inc')
121+
public function getWarningList($testFile='')
122122
{
123123
switch ($testFile) {
124124
case 'ForLoopDeclarationUnitTest.inc':

src/Standards/Squiz/Tests/ControlStructures/SwitchDeclarationUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function getErrorList($testFile='SwitchDeclarationUnitTest.inc')
143143
*
144144
* @return array<int, int>
145145
*/
146-
public function getWarningList($testFile='SwitchDeclarationUnitTest.inc')
146+
public function getWarningList($testFile='')
147147
{
148148
if ($testFile === 'SwitchDeclarationUnitTest.js') {
149149
return [273 => 1];

src/Standards/Squiz/Tests/PHP/CommentedOutCodeUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getErrorList()
4545
*
4646
* @return array<int, int>
4747
*/
48-
public function getWarningList($testFile='CommentedOutCodeUnitTest.inc')
48+
public function getWarningList($testFile='')
4949
{
5050
switch ($testFile) {
5151
case 'CommentedOutCodeUnitTest.inc':

0 commit comments

Comments
 (0)