Skip to content

Commit 8581f0c

Browse files
authored
Merge pull request #545 from biinari/chore/143-Squiz_ControlSignature_separate_parse_error
Squiz/ControlSignature: move parse error to its own file
2 parents fd065a7 + 3798bda commit 8581f0c

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc renamed to src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,3 @@ endif;
318318

319319
// Reset property.
320320
// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 1
321-
322-
// Intentional parse error. This should be the last test in the file.
323-
foreach
324-
// Some unrelated comment.

src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.inc.fixed renamed to src/Standards/Squiz/Tests/ControlStructures/ControlSignatureUnitTest.1.inc.fixed

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,3 @@ endif;
322322

323323
// Reset property.
324324
// phpcs:set Squiz.ControlStructures.ControlSignature requiredSpacesBeforeColon 1
325-
326-
// Intentional parse error. This should be the last test in the file.
327-
foreach
328-
// Some unrelated comment.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
// Intentional parse error. Live coding resilience.
4+
foreach
5+
// Some unrelated comment.

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function getErrorList($testFile='')
5555
112 => 1,
5656
];
5757

58-
if ($testFile === 'ControlSignatureUnitTest.inc') {
58+
switch ($testFile) {
59+
case 'ControlSignatureUnitTest.1.inc':
5960
$errors[122] = 1;
6061
$errors[130] = 2;
6162
$errors[134] = 1;
@@ -84,9 +85,14 @@ public function getErrorList($testFile='')
8485
$errors[306] = 3;
8586
$errors[309] = 1;
8687
$errors[315] = 1;
87-
}//end if
88+
return $errors;
8889

89-
return $errors;
90+
case 'ControlSignatureUnitTest.js':
91+
return $errors;
92+
93+
default:
94+
return [];
95+
}//end switch
9096

9197
}//end getErrorList()
9298

0 commit comments

Comments
 (0)