Skip to content

Commit 5e94c1e

Browse files
rodrigoprimojrfnl
authored andcommitted
Replace default value of first parameter in getErrorList() 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 7c29f48 commit 5e94c1e

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InlineControlStructureUnitTest extends AbstractSniffUnitTest
3030
*
3131
* @return array<int, int>
3232
*/
33-
public function getErrorList($testFile='InlineControlStructureUnitTest.1.inc')
33+
public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'InlineControlStructureUnitTest.1.inc':

src/Standards/Generic/Tests/VersionControl/GitMergeConflictUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GitMergeConflictUnitTest extends AbstractSniffUnitTest
3030
*
3131
* @return array<int, int>
3232
*/
33-
public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc')
33+
public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'GitMergeConflictUnitTest.1.inc':

src/Standards/Generic/Tests/WhiteSpace/DisallowSpaceIndentUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function setCliValues($testFile, $config)
4949
*
5050
* @return array<int, int>
5151
*/
52-
public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc')
52+
public function getErrorList($testFile='')
5353
{
5454
switch ($testFile) {
5555
case 'DisallowSpaceIndentUnitTest.1.inc':

src/Standards/Generic/Tests/WhiteSpace/ScopeIndentUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function setCliValues($testFile, $config)
5050
*
5151
* @return array<int, int>
5252
*/
53-
public function getErrorList($testFile='ScopeIndentUnitTest.inc')
53+
public function getErrorList($testFile='')
5454
{
5555
if ($testFile === 'ScopeIndentUnitTest.3.inc') {
5656
return [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FileCommentUnitTest extends AbstractSniffUnitTest
3030
*
3131
* @return array<int, int>
3232
*/
33-
public function getErrorList($testFile='FileCommentUnitTest.inc')
33+
public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'FileCommentUnitTest.1.inc':

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FileCommentUnitTest extends AbstractSniffUnitTest
3030
*
3131
* @return array<int, int>
3232
*/
33-
public function getErrorList($testFile='FileCommentUnitTest.inc')
33+
public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'FileCommentUnitTest.1.inc':

src/Standards/Squiz/Tests/WhiteSpace/SuperfluousWhitespaceUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SuperfluousWhitespaceUnitTest extends AbstractSniffUnitTest
3030
*
3131
* @return array<int, int>
3232
*/
33-
public function getErrorList($testFile='SuperfluousWhitespaceUnitTest.inc')
33+
public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'SuperfluousWhitespaceUnitTest.1.inc':

0 commit comments

Comments
 (0)