@@ -67,22 +67,22 @@ |
||
| 67 | 67 | public function getErrorList($testFile='') |
| 68 | 68 | { |
| 69 | 69 | switch ($testFile) { |
| 70 | - case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
| 71 | - return [ |
|
| 72 | - 4 => 1, |
|
| 73 | - 7 => 1, |
|
| 74 | - 8 => 1, |
|
| 75 | - 11 => 1, |
|
| 76 | - ]; |
|
| 77 | - case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
| 78 | - return [ |
|
| 79 | - 2 => 1, |
|
| 80 | - 3 => 1, |
|
| 81 | - 4 => 1, |
|
| 82 | - 5 => 1, |
|
| 83 | - ]; |
|
| 84 | - default: |
|
| 85 | - return []; |
|
| 70 | + case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
| 71 | + return [ |
|
| 72 | + 4 => 1, |
|
| 73 | + 7 => 1, |
|
| 74 | + 8 => 1, |
|
| 75 | + 11 => 1, |
|
| 76 | + ]; |
|
| 77 | + case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
| 78 | + return [ |
|
| 79 | + 2 => 1, |
|
| 80 | + 3 => 1, |
|
| 81 | + 4 => 1, |
|
| 82 | + 5 => 1, |
|
| 83 | + ]; |
|
| 84 | + default: |
|
| 85 | + return []; |
|
| 86 | 86 | }//end switch |
| 87 | 87 | |
| 88 | 88 | }//end getErrorList() |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @return array<int, int> |
| 66 | 66 | */ |
| 67 | - public function getErrorList($testFile='') |
|
| 67 | + public function getErrorList($testFile = '') |
|
| 68 | 68 | { |
| 69 | 69 | switch ($testFile) { |
| 70 | 70 | case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * @return array<int, int> |
| 100 | 100 | */ |
| 101 | - public function getWarningList($testFile='') |
|
| 101 | + public function getWarningList($testFile = '') |
|
| 102 | 102 | { |
| 103 | 103 | if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
| 104 | 104 | return [ |
@@ -15,91 +15,91 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Get a list of all test files to check. |
|
| 20 | - * |
|
| 21 | - * @param string $testFileBase The base path that the unit tests files will have. |
|
| 22 | - * |
|
| 23 | - * @return string[] |
|
| 24 | - */ |
|
| 25 | - protected function getTestFiles($testFileBase) |
|
| 26 | - { |
|
| 27 | - $testFiles = [$testFileBase.'1.inc']; |
|
| 28 | - |
|
| 29 | - $aspTags = false; |
|
| 30 | - if (PHP_VERSION_ID < 70000) { |
|
| 31 | - $aspTags = (bool) ini_get('asp_tags'); |
|
| 32 | - } |
|
| 33 | - |
|
| 34 | - if ($aspTags === true) { |
|
| 35 | - $testFiles[] = $testFileBase.'2.inc'; |
|
| 36 | - } else { |
|
| 37 | - $testFiles[] = $testFileBase.'3.inc'; |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - return $testFiles; |
|
| 41 | - |
|
| 42 | - }//end getTestFiles() |
|
| 43 | - |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * Returns the lines where errors should occur. |
|
| 47 | - * |
|
| 48 | - * The key of the array should represent the line number and the value |
|
| 49 | - * should represent the number of errors that should occur on that line. |
|
| 50 | - * |
|
| 51 | - * @param string $testFile The name of the file being tested. |
|
| 52 | - * |
|
| 53 | - * @return array<int, int> |
|
| 54 | - */ |
|
| 55 | - public function getErrorList($testFile='') |
|
| 56 | - { |
|
| 57 | - switch ($testFile) { |
|
| 58 | - case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
| 59 | - return [ |
|
| 60 | - 4 => 1, |
|
| 61 | - 7 => 1, |
|
| 62 | - 8 => 1, |
|
| 63 | - 11 => 1, |
|
| 64 | - ]; |
|
| 65 | - case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
| 66 | - return [ |
|
| 67 | - 2 => 1, |
|
| 68 | - 3 => 1, |
|
| 69 | - 4 => 1, |
|
| 70 | - 5 => 1, |
|
| 71 | - ]; |
|
| 72 | - default: |
|
| 73 | - return []; |
|
| 74 | - }//end switch |
|
| 75 | - |
|
| 76 | - }//end getErrorList() |
|
| 77 | - |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * Returns the lines where warnings should occur. |
|
| 81 | - * |
|
| 82 | - * The key of the array should represent the line number and the value |
|
| 83 | - * should represent the number of warnings that should occur on that line. |
|
| 84 | - * |
|
| 85 | - * @param string $testFile The name of the file being tested. |
|
| 86 | - * |
|
| 87 | - * @return array<int, int> |
|
| 88 | - */ |
|
| 89 | - public function getWarningList($testFile='') |
|
| 90 | - { |
|
| 91 | - if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
|
| 92 | - return [ |
|
| 93 | - 3 => 1, |
|
| 94 | - 4 => 1, |
|
| 95 | - 5 => 1, |
|
| 96 | - 6 => 1, |
|
| 97 | - ]; |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - return []; |
|
| 101 | - |
|
| 102 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Get a list of all test files to check. |
|
| 20 | + * |
|
| 21 | + * @param string $testFileBase The base path that the unit tests files will have. |
|
| 22 | + * |
|
| 23 | + * @return string[] |
|
| 24 | + */ |
|
| 25 | + protected function getTestFiles($testFileBase) |
|
| 26 | + { |
|
| 27 | + $testFiles = [$testFileBase.'1.inc']; |
|
| 28 | + |
|
| 29 | + $aspTags = false; |
|
| 30 | + if (PHP_VERSION_ID < 70000) { |
|
| 31 | + $aspTags = (bool) ini_get('asp_tags'); |
|
| 32 | + } |
|
| 33 | + |
|
| 34 | + if ($aspTags === true) { |
|
| 35 | + $testFiles[] = $testFileBase.'2.inc'; |
|
| 36 | + } else { |
|
| 37 | + $testFiles[] = $testFileBase.'3.inc'; |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + return $testFiles; |
|
| 41 | + |
|
| 42 | + }//end getTestFiles() |
|
| 43 | + |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * Returns the lines where errors should occur. |
|
| 47 | + * |
|
| 48 | + * The key of the array should represent the line number and the value |
|
| 49 | + * should represent the number of errors that should occur on that line. |
|
| 50 | + * |
|
| 51 | + * @param string $testFile The name of the file being tested. |
|
| 52 | + * |
|
| 53 | + * @return array<int, int> |
|
| 54 | + */ |
|
| 55 | + public function getErrorList($testFile='') |
|
| 56 | + { |
|
| 57 | + switch ($testFile) { |
|
| 58 | + case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
|
| 59 | + return [ |
|
| 60 | + 4 => 1, |
|
| 61 | + 7 => 1, |
|
| 62 | + 8 => 1, |
|
| 63 | + 11 => 1, |
|
| 64 | + ]; |
|
| 65 | + case 'DisallowAlternativePHPTagsUnitTest.2.inc': |
|
| 66 | + return [ |
|
| 67 | + 2 => 1, |
|
| 68 | + 3 => 1, |
|
| 69 | + 4 => 1, |
|
| 70 | + 5 => 1, |
|
| 71 | + ]; |
|
| 72 | + default: |
|
| 73 | + return []; |
|
| 74 | + }//end switch |
|
| 75 | + |
|
| 76 | + }//end getErrorList() |
|
| 77 | + |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * Returns the lines where warnings should occur. |
|
| 81 | + * |
|
| 82 | + * The key of the array should represent the line number and the value |
|
| 83 | + * should represent the number of warnings that should occur on that line. |
|
| 84 | + * |
|
| 85 | + * @param string $testFile The name of the file being tested. |
|
| 86 | + * |
|
| 87 | + * @return array<int, int> |
|
| 88 | + */ |
|
| 89 | + public function getWarningList($testFile='') |
|
| 90 | + { |
|
| 91 | + if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
|
| 92 | + return [ |
|
| 93 | + 3 => 1, |
|
| 94 | + 4 => 1, |
|
| 95 | + 5 => 1, |
|
| 96 | + 6 => 1, |
|
| 97 | + ]; |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + return []; |
|
| 101 | + |
|
| 102 | + }//end getWarningList() |
|
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | }//end class |
@@ -15,39 +15,39 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return []; |
|
| 29 | - |
|
| 30 | - }//end getErrorList() |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Returns the lines where warnings should occur. |
|
| 35 | - * |
|
| 36 | - * The key of the array should represent the line number and the value |
|
| 37 | - * should represent the number of warnings that should occur on that line. |
|
| 38 | - * |
|
| 39 | - * @return array<int, int> |
|
| 40 | - */ |
|
| 41 | - public function getWarningList() |
|
| 42 | - { |
|
| 43 | - return [ |
|
| 44 | - 3 => 1, |
|
| 45 | - 6 => 1, |
|
| 46 | - 11 => 1, |
|
| 47 | - 16 => 1, |
|
| 48 | - ]; |
|
| 49 | - |
|
| 50 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return []; |
|
| 29 | + |
|
| 30 | + }//end getErrorList() |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Returns the lines where warnings should occur. |
|
| 35 | + * |
|
| 36 | + * The key of the array should represent the line number and the value |
|
| 37 | + * should represent the number of warnings that should occur on that line. |
|
| 38 | + * |
|
| 39 | + * @return array<int, int> |
|
| 40 | + */ |
|
| 41 | + public function getWarningList() |
|
| 42 | + { |
|
| 43 | + return [ |
|
| 44 | + 3 => 1, |
|
| 45 | + 6 => 1, |
|
| 46 | + 11 => 1, |
|
| 47 | + 16 => 1, |
|
| 48 | + ]; |
|
| 49 | + |
|
| 50 | + }//end getWarningList() |
|
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | }//end class |
@@ -15,34 +15,34 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [2 => 1]; |
|
| 29 | - |
|
| 30 | - }//end getErrorList() |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Returns the lines where warnings should occur. |
|
| 35 | - * |
|
| 36 | - * The key of the array should represent the line number and the value |
|
| 37 | - * should represent the number of warnings that should occur on that line. |
|
| 38 | - * |
|
| 39 | - * @return array<int, int> |
|
| 40 | - */ |
|
| 41 | - public function getWarningList() |
|
| 42 | - { |
|
| 43 | - return []; |
|
| 44 | - |
|
| 45 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [2 => 1]; |
|
| 29 | + |
|
| 30 | + }//end getErrorList() |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Returns the lines where warnings should occur. |
|
| 35 | + * |
|
| 36 | + * The key of the array should represent the line number and the value |
|
| 37 | + * should represent the number of warnings that should occur on that line. |
|
| 38 | + * |
|
| 39 | + * @return array<int, int> |
|
| 40 | + */ |
|
| 41 | + public function getWarningList() |
|
| 42 | + { |
|
| 43 | + return []; |
|
| 44 | + |
|
| 45 | + }//end getWarningList() |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | }//end class |
@@ -15,40 +15,40 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - $errors = [ |
|
| 29 | - 2 => 1, |
|
| 30 | - 4 => 1, |
|
| 31 | - 6 => 1, |
|
| 32 | - ]; |
|
| 33 | - |
|
| 34 | - return $errors; |
|
| 35 | - |
|
| 36 | - }//end getErrorList() |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Returns the lines where warnings should occur. |
|
| 41 | - * |
|
| 42 | - * The key of the array should represent the line number and the value |
|
| 43 | - * should represent the number of warnings that should occur on that line. |
|
| 44 | - * |
|
| 45 | - * @return array<int, int> |
|
| 46 | - */ |
|
| 47 | - public function getWarningList() |
|
| 48 | - { |
|
| 49 | - return []; |
|
| 50 | - |
|
| 51 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + $errors = [ |
|
| 29 | + 2 => 1, |
|
| 30 | + 4 => 1, |
|
| 31 | + 6 => 1, |
|
| 32 | + ]; |
|
| 33 | + |
|
| 34 | + return $errors; |
|
| 35 | + |
|
| 36 | + }//end getErrorList() |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Returns the lines where warnings should occur. |
|
| 41 | + * |
|
| 42 | + * The key of the array should represent the line number and the value |
|
| 43 | + * should represent the number of warnings that should occur on that line. |
|
| 44 | + * |
|
| 45 | + * @return array<int, int> |
|
| 46 | + */ |
|
| 47 | + public function getWarningList() |
|
| 48 | + { |
|
| 49 | + return []; |
|
| 50 | + |
|
| 51 | + }//end getWarningList() |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | }//end class |
@@ -15,34 +15,34 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [2 => 2]; |
|
| 29 | - |
|
| 30 | - }//end getErrorList() |
|
| 31 | - |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Returns the lines where warnings should occur. |
|
| 35 | - * |
|
| 36 | - * The key of the array should represent the line number and the value |
|
| 37 | - * should represent the number of warnings that should occur on that line. |
|
| 38 | - * |
|
| 39 | - * @return array<int, int> |
|
| 40 | - */ |
|
| 41 | - public function getWarningList() |
|
| 42 | - { |
|
| 43 | - return []; |
|
| 44 | - |
|
| 45 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [2 => 2]; |
|
| 29 | + |
|
| 30 | + }//end getErrorList() |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Returns the lines where warnings should occur. |
|
| 35 | + * |
|
| 36 | + * The key of the array should represent the line number and the value |
|
| 37 | + * should represent the number of warnings that should occur on that line. |
|
| 38 | + * |
|
| 39 | + * @return array<int, int> |
|
| 40 | + */ |
|
| 41 | + public function getWarningList() |
|
| 42 | + { |
|
| 43 | + return []; |
|
| 44 | + |
|
| 45 | + }//end getWarningList() |
|
| 46 | 46 | |
| 47 | 47 | |
| 48 | 48 | }//end class |
@@ -15,49 +15,49 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns the lines where errors should occur. |
|
| 20 | - * |
|
| 21 | - * The key of the array should represent the line number and the value |
|
| 22 | - * should represent the number of errors that should occur on that line. |
|
| 23 | - * |
|
| 24 | - * @return array<int, int> |
|
| 25 | - */ |
|
| 26 | - public function getErrorList() |
|
| 27 | - { |
|
| 28 | - return [ |
|
| 29 | - 7 => 1, |
|
| 30 | - 10 => 1, |
|
| 31 | - 15 => 1, |
|
| 32 | - 16 => 1, |
|
| 33 | - 23 => 1, |
|
| 34 | - 26 => 1, |
|
| 35 | - 31 => 1, |
|
| 36 | - 32 => 1, |
|
| 37 | - 39 => 1, |
|
| 38 | - 42 => 1, |
|
| 39 | - 47 => 1, |
|
| 40 | - 48 => 1, |
|
| 41 | - 70 => 1, |
|
| 42 | - 71 => 1, |
|
| 43 | - ]; |
|
| 44 | - |
|
| 45 | - }//end getErrorList() |
|
| 46 | - |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * Returns the lines where warnings should occur. |
|
| 50 | - * |
|
| 51 | - * The key of the array should represent the line number and the value |
|
| 52 | - * should represent the number of warnings that should occur on that line. |
|
| 53 | - * |
|
| 54 | - * @return array<int, int> |
|
| 55 | - */ |
|
| 56 | - public function getWarningList() |
|
| 57 | - { |
|
| 58 | - return []; |
|
| 59 | - |
|
| 60 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Returns the lines where errors should occur. |
|
| 20 | + * |
|
| 21 | + * The key of the array should represent the line number and the value |
|
| 22 | + * should represent the number of errors that should occur on that line. |
|
| 23 | + * |
|
| 24 | + * @return array<int, int> |
|
| 25 | + */ |
|
| 26 | + public function getErrorList() |
|
| 27 | + { |
|
| 28 | + return [ |
|
| 29 | + 7 => 1, |
|
| 30 | + 10 => 1, |
|
| 31 | + 15 => 1, |
|
| 32 | + 16 => 1, |
|
| 33 | + 23 => 1, |
|
| 34 | + 26 => 1, |
|
| 35 | + 31 => 1, |
|
| 36 | + 32 => 1, |
|
| 37 | + 39 => 1, |
|
| 38 | + 42 => 1, |
|
| 39 | + 47 => 1, |
|
| 40 | + 48 => 1, |
|
| 41 | + 70 => 1, |
|
| 42 | + 71 => 1, |
|
| 43 | + ]; |
|
| 44 | + |
|
| 45 | + }//end getErrorList() |
|
| 46 | + |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * Returns the lines where warnings should occur. |
|
| 50 | + * |
|
| 51 | + * The key of the array should represent the line number and the value |
|
| 52 | + * should represent the number of warnings that should occur on that line. |
|
| 53 | + * |
|
| 54 | + * @return array<int, int> |
|
| 55 | + */ |
|
| 56 | + public function getWarningList() |
|
| 57 | + { |
|
| 58 | + return []; |
|
| 59 | + |
|
| 60 | + }//end getWarningList() |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | }//end class |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | echo 'Bar'; |
| 8 | 8 | |
| 9 | 9 | for($i=0,$j=50; $i<100; $i++) { |
| 10 | - while($j--) { |
|
| 11 | - if($j==17) goto end; |
|
| 12 | - } |
|
| 10 | + while($j--) { |
|
| 11 | + if($j==17) goto end; |
|
| 12 | + } |
|
| 13 | 13 | } |
| 14 | 14 | echo "i = $i"; |
| 15 | 15 | |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | a: |
| 7 | 7 | echo 'Bar'; |
| 8 | 8 | |
| 9 | -for($i=0,$j=50; $i<100; $i++) { |
|
| 10 | - while($j--) { |
|
| 11 | - if($j==17) goto end; |
|
| 9 | +for ($i = 0, $j = 50; $i < 100; $i++) { |
|
| 10 | + while ($j--) { |
|
| 11 | + if ($j == 17) goto end; |
|
| 12 | 12 | } |
| 13 | 13 | } |
| 14 | 14 | echo "i = $i"; |
@@ -8,7 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | for($i=0,$j=50; $i<100; $i++) { |
| 10 | 10 | while($j--) { |
| 11 | - if($j==17) goto end; |
|
| 11 | + if($j==17) { |
|
| 12 | + goto end; |
|
| 13 | + } |
|
| 12 | 14 | } |
| 13 | 15 | } |
| 14 | 16 | echo "i = $i"; |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | * |
| 45 | 45 | * @return array<int, int> |
| 46 | 46 | */ |
| 47 | - public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') |
|
| 47 | + public function getErrorList($testFile = 'DisallowSpaceIndentUnitTest.1.inc') |
|
| 48 | 48 | { |
| 49 | 49 | switch ($testFile) { |
| 50 | 50 | case 'DisallowSpaceIndentUnitTest.1.inc': |
@@ -15,115 +15,115 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Get a list of CLI values to set before the file is tested. |
|
| 20 | - * |
|
| 21 | - * @param string $testFile The name of the file being tested. |
|
| 22 | - * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
| 23 | - * |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function setCliValues($testFile, $config) |
|
| 27 | - { |
|
| 28 | - if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') { |
|
| 29 | - return; |
|
| 30 | - } |
|
| 18 | + /** |
|
| 19 | + * Get a list of CLI values to set before the file is tested. |
|
| 20 | + * |
|
| 21 | + * @param string $testFile The name of the file being tested. |
|
| 22 | + * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function setCliValues($testFile, $config) |
|
| 27 | + { |
|
| 28 | + if ($testFile === 'DisallowSpaceIndentUnitTest.2.inc') { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - $config->tabWidth = 4; |
|
| 32 | + $config->tabWidth = 4; |
|
| 33 | 33 | |
| 34 | - }//end setCliValues() |
|
| 34 | + }//end setCliValues() |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * Returns the lines where errors should occur. |
|
| 39 | - * |
|
| 40 | - * The key of the array should represent the line number and the value |
|
| 41 | - * should represent the number of errors that should occur on that line. |
|
| 42 | - * |
|
| 43 | - * @param string $testFile The name of the file being tested. |
|
| 44 | - * |
|
| 45 | - * @return array<int, int> |
|
| 46 | - */ |
|
| 47 | - public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') |
|
| 48 | - { |
|
| 49 | - switch ($testFile) { |
|
| 50 | - case 'DisallowSpaceIndentUnitTest.1.inc': |
|
| 51 | - case 'DisallowSpaceIndentUnitTest.2.inc': |
|
| 52 | - return [ |
|
| 53 | - 5 => 1, |
|
| 54 | - 9 => 1, |
|
| 55 | - 15 => 1, |
|
| 56 | - 22 => 1, |
|
| 57 | - 24 => 1, |
|
| 58 | - 30 => 1, |
|
| 59 | - 35 => 1, |
|
| 60 | - 50 => 1, |
|
| 61 | - 55 => 1, |
|
| 62 | - 57 => 1, |
|
| 63 | - 58 => 1, |
|
| 64 | - 59 => 1, |
|
| 65 | - 60 => 1, |
|
| 66 | - 65 => 1, |
|
| 67 | - 66 => 1, |
|
| 68 | - 67 => 1, |
|
| 69 | - 68 => 1, |
|
| 70 | - 69 => 1, |
|
| 71 | - 70 => 1, |
|
| 72 | - 73 => 1, |
|
| 73 | - 77 => 1, |
|
| 74 | - 81 => 1, |
|
| 75 | - 104 => 1, |
|
| 76 | - 105 => 1, |
|
| 77 | - 106 => 1, |
|
| 78 | - 107 => 1, |
|
| 79 | - 108 => 1, |
|
| 80 | - 110 => 1, |
|
| 81 | - 111 => 1, |
|
| 82 | - 112 => 1, |
|
| 83 | - 114 => 1, |
|
| 84 | - 115 => 1, |
|
| 85 | - 117 => 1, |
|
| 86 | - 118 => 1, |
|
| 87 | - ]; |
|
| 88 | - break; |
|
| 89 | - case 'DisallowSpaceIndentUnitTest.3.inc': |
|
| 90 | - return [ |
|
| 91 | - 2 => 1, |
|
| 92 | - 5 => 1, |
|
| 93 | - 10 => 1, |
|
| 94 | - 12 => 1, |
|
| 95 | - 13 => 1, |
|
| 96 | - 14 => 1, |
|
| 97 | - 15 => 1, |
|
| 98 | - ]; |
|
| 99 | - break; |
|
| 100 | - case 'DisallowSpaceIndentUnitTest.js': |
|
| 101 | - return [3 => 1]; |
|
| 102 | - break; |
|
| 103 | - case 'DisallowSpaceIndentUnitTest.css': |
|
| 104 | - return [2 => 1]; |
|
| 105 | - break; |
|
| 106 | - default: |
|
| 107 | - return []; |
|
| 108 | - break; |
|
| 109 | - }//end switch |
|
| 37 | + /** |
|
| 38 | + * Returns the lines where errors should occur. |
|
| 39 | + * |
|
| 40 | + * The key of the array should represent the line number and the value |
|
| 41 | + * should represent the number of errors that should occur on that line. |
|
| 42 | + * |
|
| 43 | + * @param string $testFile The name of the file being tested. |
|
| 44 | + * |
|
| 45 | + * @return array<int, int> |
|
| 46 | + */ |
|
| 47 | + public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') |
|
| 48 | + { |
|
| 49 | + switch ($testFile) { |
|
| 50 | + case 'DisallowSpaceIndentUnitTest.1.inc': |
|
| 51 | + case 'DisallowSpaceIndentUnitTest.2.inc': |
|
| 52 | + return [ |
|
| 53 | + 5 => 1, |
|
| 54 | + 9 => 1, |
|
| 55 | + 15 => 1, |
|
| 56 | + 22 => 1, |
|
| 57 | + 24 => 1, |
|
| 58 | + 30 => 1, |
|
| 59 | + 35 => 1, |
|
| 60 | + 50 => 1, |
|
| 61 | + 55 => 1, |
|
| 62 | + 57 => 1, |
|
| 63 | + 58 => 1, |
|
| 64 | + 59 => 1, |
|
| 65 | + 60 => 1, |
|
| 66 | + 65 => 1, |
|
| 67 | + 66 => 1, |
|
| 68 | + 67 => 1, |
|
| 69 | + 68 => 1, |
|
| 70 | + 69 => 1, |
|
| 71 | + 70 => 1, |
|
| 72 | + 73 => 1, |
|
| 73 | + 77 => 1, |
|
| 74 | + 81 => 1, |
|
| 75 | + 104 => 1, |
|
| 76 | + 105 => 1, |
|
| 77 | + 106 => 1, |
|
| 78 | + 107 => 1, |
|
| 79 | + 108 => 1, |
|
| 80 | + 110 => 1, |
|
| 81 | + 111 => 1, |
|
| 82 | + 112 => 1, |
|
| 83 | + 114 => 1, |
|
| 84 | + 115 => 1, |
|
| 85 | + 117 => 1, |
|
| 86 | + 118 => 1, |
|
| 87 | + ]; |
|
| 88 | + break; |
|
| 89 | + case 'DisallowSpaceIndentUnitTest.3.inc': |
|
| 90 | + return [ |
|
| 91 | + 2 => 1, |
|
| 92 | + 5 => 1, |
|
| 93 | + 10 => 1, |
|
| 94 | + 12 => 1, |
|
| 95 | + 13 => 1, |
|
| 96 | + 14 => 1, |
|
| 97 | + 15 => 1, |
|
| 98 | + ]; |
|
| 99 | + break; |
|
| 100 | + case 'DisallowSpaceIndentUnitTest.js': |
|
| 101 | + return [3 => 1]; |
|
| 102 | + break; |
|
| 103 | + case 'DisallowSpaceIndentUnitTest.css': |
|
| 104 | + return [2 => 1]; |
|
| 105 | + break; |
|
| 106 | + default: |
|
| 107 | + return []; |
|
| 108 | + break; |
|
| 109 | + }//end switch |
|
| 110 | 110 | |
| 111 | - }//end getErrorList() |
|
| 111 | + }//end getErrorList() |
|
| 112 | 112 | |
| 113 | 113 | |
| 114 | - /** |
|
| 115 | - * Returns the lines where warnings should occur. |
|
| 116 | - * |
|
| 117 | - * The key of the array should represent the line number and the value |
|
| 118 | - * should represent the number of warnings that should occur on that line. |
|
| 119 | - * |
|
| 120 | - * @return array<int, int> |
|
| 121 | - */ |
|
| 122 | - public function getWarningList() |
|
| 123 | - { |
|
| 124 | - return []; |
|
| 114 | + /** |
|
| 115 | + * Returns the lines where warnings should occur. |
|
| 116 | + * |
|
| 117 | + * The key of the array should represent the line number and the value |
|
| 118 | + * should represent the number of warnings that should occur on that line. |
|
| 119 | + * |
|
| 120 | + * @return array<int, int> |
|
| 121 | + */ |
|
| 122 | + public function getWarningList() |
|
| 123 | + { |
|
| 124 | + return []; |
|
| 125 | 125 | |
| 126 | - }//end getWarningList() |
|
| 126 | + }//end getWarningList() |
|
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | }//end class |
@@ -47,65 +47,65 @@ |
||
| 47 | 47 | public function getErrorList($testFile='DisallowSpaceIndentUnitTest.1.inc') |
| 48 | 48 | { |
| 49 | 49 | switch ($testFile) { |
| 50 | - case 'DisallowSpaceIndentUnitTest.1.inc': |
|
| 51 | - case 'DisallowSpaceIndentUnitTest.2.inc': |
|
| 52 | - return [ |
|
| 53 | - 5 => 1, |
|
| 54 | - 9 => 1, |
|
| 55 | - 15 => 1, |
|
| 56 | - 22 => 1, |
|
| 57 | - 24 => 1, |
|
| 58 | - 30 => 1, |
|
| 59 | - 35 => 1, |
|
| 60 | - 50 => 1, |
|
| 61 | - 55 => 1, |
|
| 62 | - 57 => 1, |
|
| 63 | - 58 => 1, |
|
| 64 | - 59 => 1, |
|
| 65 | - 60 => 1, |
|
| 66 | - 65 => 1, |
|
| 67 | - 66 => 1, |
|
| 68 | - 67 => 1, |
|
| 69 | - 68 => 1, |
|
| 70 | - 69 => 1, |
|
| 71 | - 70 => 1, |
|
| 72 | - 73 => 1, |
|
| 73 | - 77 => 1, |
|
| 74 | - 81 => 1, |
|
| 75 | - 104 => 1, |
|
| 76 | - 105 => 1, |
|
| 77 | - 106 => 1, |
|
| 78 | - 107 => 1, |
|
| 79 | - 108 => 1, |
|
| 80 | - 110 => 1, |
|
| 81 | - 111 => 1, |
|
| 82 | - 112 => 1, |
|
| 83 | - 114 => 1, |
|
| 84 | - 115 => 1, |
|
| 85 | - 117 => 1, |
|
| 86 | - 118 => 1, |
|
| 87 | - ]; |
|
| 88 | - break; |
|
| 89 | - case 'DisallowSpaceIndentUnitTest.3.inc': |
|
| 90 | - return [ |
|
| 91 | - 2 => 1, |
|
| 92 | - 5 => 1, |
|
| 93 | - 10 => 1, |
|
| 94 | - 12 => 1, |
|
| 95 | - 13 => 1, |
|
| 96 | - 14 => 1, |
|
| 97 | - 15 => 1, |
|
| 98 | - ]; |
|
| 99 | - break; |
|
| 100 | - case 'DisallowSpaceIndentUnitTest.js': |
|
| 101 | - return [3 => 1]; |
|
| 102 | - break; |
|
| 103 | - case 'DisallowSpaceIndentUnitTest.css': |
|
| 104 | - return [2 => 1]; |
|
| 105 | - break; |
|
| 106 | - default: |
|
| 107 | - return []; |
|
| 108 | - break; |
|
| 50 | + case 'DisallowSpaceIndentUnitTest.1.inc': |
|
| 51 | + case 'DisallowSpaceIndentUnitTest.2.inc': |
|
| 52 | + return [ |
|
| 53 | + 5 => 1, |
|
| 54 | + 9 => 1, |
|
| 55 | + 15 => 1, |
|
| 56 | + 22 => 1, |
|
| 57 | + 24 => 1, |
|
| 58 | + 30 => 1, |
|
| 59 | + 35 => 1, |
|
| 60 | + 50 => 1, |
|
| 61 | + 55 => 1, |
|
| 62 | + 57 => 1, |
|
| 63 | + 58 => 1, |
|
| 64 | + 59 => 1, |
|
| 65 | + 60 => 1, |
|
| 66 | + 65 => 1, |
|
| 67 | + 66 => 1, |
|
| 68 | + 67 => 1, |
|
| 69 | + 68 => 1, |
|
| 70 | + 69 => 1, |
|
| 71 | + 70 => 1, |
|
| 72 | + 73 => 1, |
|
| 73 | + 77 => 1, |
|
| 74 | + 81 => 1, |
|
| 75 | + 104 => 1, |
|
| 76 | + 105 => 1, |
|
| 77 | + 106 => 1, |
|
| 78 | + 107 => 1, |
|
| 79 | + 108 => 1, |
|
| 80 | + 110 => 1, |
|
| 81 | + 111 => 1, |
|
| 82 | + 112 => 1, |
|
| 83 | + 114 => 1, |
|
| 84 | + 115 => 1, |
|
| 85 | + 117 => 1, |
|
| 86 | + 118 => 1, |
|
| 87 | + ]; |
|
| 88 | + break; |
|
| 89 | + case 'DisallowSpaceIndentUnitTest.3.inc': |
|
| 90 | + return [ |
|
| 91 | + 2 => 1, |
|
| 92 | + 5 => 1, |
|
| 93 | + 10 => 1, |
|
| 94 | + 12 => 1, |
|
| 95 | + 13 => 1, |
|
| 96 | + 14 => 1, |
|
| 97 | + 15 => 1, |
|
| 98 | + ]; |
|
| 99 | + break; |
|
| 100 | + case 'DisallowSpaceIndentUnitTest.js': |
|
| 101 | + return [3 => 1]; |
|
| 102 | + break; |
|
| 103 | + case 'DisallowSpaceIndentUnitTest.css': |
|
| 104 | + return [2 => 1]; |
|
| 105 | + break; |
|
| 106 | + default: |
|
| 107 | + return []; |
|
| 108 | + break; |
|
| 109 | 109 | }//end switch |
| 110 | 110 | |
| 111 | 111 | }//end getErrorList() |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | * |
| 46 | 46 | * @return array<int, int> |
| 47 | 47 | */ |
| 48 | - public function getErrorList($testFile='ScopeIndentUnitTest.inc') |
|
| 48 | + public function getErrorList($testFile = 'ScopeIndentUnitTest.inc') |
|
| 49 | 49 | { |
| 50 | 50 | if ($testFile === 'ScopeIndentUnitTest.1.js') { |
| 51 | 51 | return [ |
@@ -15,200 +15,200 @@ |
||
| 15 | 15 | { |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Get a list of CLI values to set before the file is tested. |
|
| 20 | - * |
|
| 21 | - * @param string $testFile The name of the file being tested. |
|
| 22 | - * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
| 23 | - * |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function setCliValues($testFile, $config) |
|
| 27 | - { |
|
| 28 | - // Tab width setting is only needed for the tabbed file. |
|
| 29 | - if ($testFile === 'ScopeIndentUnitTest.2.inc') { |
|
| 30 | - $config->tabWidth = 4; |
|
| 31 | - } else { |
|
| 32 | - $config->tabWidth = 0; |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - }//end setCliValues() |
|
| 36 | - |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Returns the lines where errors should occur. |
|
| 40 | - * |
|
| 41 | - * The key of the array should represent the line number and the value |
|
| 42 | - * should represent the number of errors that should occur on that line. |
|
| 43 | - * |
|
| 44 | - * @param string $testFile The name of the file being tested. |
|
| 45 | - * |
|
| 46 | - * @return array<int, int> |
|
| 47 | - */ |
|
| 48 | - public function getErrorList($testFile='ScopeIndentUnitTest.inc') |
|
| 49 | - { |
|
| 50 | - if ($testFile === 'ScopeIndentUnitTest.1.js') { |
|
| 51 | - return [ |
|
| 52 | - 6 => 1, |
|
| 53 | - 14 => 1, |
|
| 54 | - 21 => 1, |
|
| 55 | - 30 => 1, |
|
| 56 | - 32 => 1, |
|
| 57 | - 33 => 1, |
|
| 58 | - 34 => 1, |
|
| 59 | - 39 => 1, |
|
| 60 | - 42 => 1, |
|
| 61 | - 59 => 1, |
|
| 62 | - 60 => 1, |
|
| 63 | - 75 => 1, |
|
| 64 | - 120 => 1, |
|
| 65 | - 121 => 1, |
|
| 66 | - 122 => 1, |
|
| 67 | - 123 => 1, |
|
| 68 | - 141 => 1, |
|
| 69 | - 142 => 1, |
|
| 70 | - 155 => 1, |
|
| 71 | - 156 => 1, |
|
| 72 | - 168 => 1, |
|
| 73 | - 184 => 1, |
|
| 74 | - ]; |
|
| 75 | - }//end if |
|
| 76 | - |
|
| 77 | - if ($testFile === 'ScopeIndentUnitTest.3.inc') { |
|
| 78 | - return [ |
|
| 79 | - 6 => 1, |
|
| 80 | - 7 => 1, |
|
| 81 | - 10 => 1, |
|
| 82 | - ]; |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - if ($testFile === 'ScopeIndentUnitTest.4.inc') { |
|
| 86 | - return []; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - return [ |
|
| 90 | - 7 => 1, |
|
| 91 | - 10 => 1, |
|
| 92 | - 13 => 1, |
|
| 93 | - 17 => 1, |
|
| 94 | - 20 => 1, |
|
| 95 | - 24 => 1, |
|
| 96 | - 25 => 1, |
|
| 97 | - 27 => 1, |
|
| 98 | - 28 => 1, |
|
| 99 | - 29 => 1, |
|
| 100 | - 30 => 1, |
|
| 101 | - 58 => 1, |
|
| 102 | - 123 => 1, |
|
| 103 | - 224 => 1, |
|
| 104 | - 225 => 1, |
|
| 105 | - 279 => 1, |
|
| 106 | - 280 => 1, |
|
| 107 | - 281 => 1, |
|
| 108 | - 282 => 1, |
|
| 109 | - 283 => 1, |
|
| 110 | - 284 => 1, |
|
| 111 | - 285 => 1, |
|
| 112 | - 286 => 1, |
|
| 113 | - 336 => 1, |
|
| 114 | - 349 => 1, |
|
| 115 | - 380 => 1, |
|
| 116 | - 386 => 1, |
|
| 117 | - 387 => 1, |
|
| 118 | - 388 => 1, |
|
| 119 | - 389 => 1, |
|
| 120 | - 390 => 1, |
|
| 121 | - 397 => 1, |
|
| 122 | - 419 => 1, |
|
| 123 | - 420 => 1, |
|
| 124 | - 465 => 1, |
|
| 125 | - 467 => 1, |
|
| 126 | - 472 => 1, |
|
| 127 | - 473 => 1, |
|
| 128 | - 474 => 1, |
|
| 129 | - 496 => 1, |
|
| 130 | - 498 => 1, |
|
| 131 | - 500 => 1, |
|
| 132 | - 524 => 1, |
|
| 133 | - 526 => 1, |
|
| 134 | - 544 => 1, |
|
| 135 | - 545 => 1, |
|
| 136 | - 546 => 1, |
|
| 137 | - 639 => 1, |
|
| 138 | - 660 => 1, |
|
| 139 | - 662 => 1, |
|
| 140 | - 802 => 1, |
|
| 141 | - 803 => 1, |
|
| 142 | - 823 => 1, |
|
| 143 | - 858 => 1, |
|
| 144 | - 879 => 1, |
|
| 145 | - 1163 => 1, |
|
| 146 | - 1197 => 1, |
|
| 147 | - 1198 => 1, |
|
| 148 | - 1259 => 1, |
|
| 149 | - 1264 => 1, |
|
| 150 | - 1265 => 1, |
|
| 151 | - 1266 => 1, |
|
| 152 | - 1269 => 1, |
|
| 153 | - 1272 => 1, |
|
| 154 | - 1273 => 1, |
|
| 155 | - 1274 => 1, |
|
| 156 | - 1275 => 1, |
|
| 157 | - 1276 => 1, |
|
| 158 | - 1277 => 1, |
|
| 159 | - 1280 => 1, |
|
| 160 | - 1281 => 1, |
|
| 161 | - 1282 => 1, |
|
| 162 | - 1284 => 1, |
|
| 163 | - 1285 => 1, |
|
| 164 | - 1288 => 1, |
|
| 165 | - 1289 => 1, |
|
| 166 | - 1290 => 1, |
|
| 167 | - 1292 => 1, |
|
| 168 | - 1293 => 1, |
|
| 169 | - 1310 => 1, |
|
| 170 | - 1312 => 1, |
|
| 171 | - 1327 => 1, |
|
| 172 | - 1328 => 1, |
|
| 173 | - 1329 => 1, |
|
| 174 | - 1330 => 1, |
|
| 175 | - 1331 => 1, |
|
| 176 | - 1332 => 1, |
|
| 177 | - 1335 => 1, |
|
| 178 | - 1340 => 1, |
|
| 179 | - 1342 => 1, |
|
| 180 | - 1345 => 1, |
|
| 181 | - 1488 => 1, |
|
| 182 | - 1489 => 1, |
|
| 183 | - 1500 => 1, |
|
| 184 | - 1503 => 1, |
|
| 185 | - 1518 => 1, |
|
| 186 | - 1520 => 1, |
|
| 187 | - 1527 => 1, |
|
| 188 | - 1529 => 1, |
|
| 189 | - 1530 => 1, |
|
| 190 | - 1567 => 1, |
|
| 191 | - 1568 => 1, |
|
| 192 | - 1569 => 1, |
|
| 193 | - 1570 => 1, |
|
| 194 | - ]; |
|
| 195 | - |
|
| 196 | - }//end getErrorList() |
|
| 197 | - |
|
| 198 | - |
|
| 199 | - /** |
|
| 200 | - * Returns the lines where warnings should occur. |
|
| 201 | - * |
|
| 202 | - * The key of the array should represent the line number and the value |
|
| 203 | - * should represent the number of warnings that should occur on that line. |
|
| 204 | - * |
|
| 205 | - * @return array<int, int> |
|
| 206 | - */ |
|
| 207 | - public function getWarningList() |
|
| 208 | - { |
|
| 209 | - return []; |
|
| 210 | - |
|
| 211 | - }//end getWarningList() |
|
| 18 | + /** |
|
| 19 | + * Get a list of CLI values to set before the file is tested. |
|
| 20 | + * |
|
| 21 | + * @param string $testFile The name of the file being tested. |
|
| 22 | + * @param \PHP_CodeSniffer\Config $config The config data for the test run. |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function setCliValues($testFile, $config) |
|
| 27 | + { |
|
| 28 | + // Tab width setting is only needed for the tabbed file. |
|
| 29 | + if ($testFile === 'ScopeIndentUnitTest.2.inc') { |
|
| 30 | + $config->tabWidth = 4; |
|
| 31 | + } else { |
|
| 32 | + $config->tabWidth = 0; |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + }//end setCliValues() |
|
| 36 | + |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Returns the lines where errors should occur. |
|
| 40 | + * |
|
| 41 | + * The key of the array should represent the line number and the value |
|
| 42 | + * should represent the number of errors that should occur on that line. |
|
| 43 | + * |
|
| 44 | + * @param string $testFile The name of the file being tested. |
|
| 45 | + * |
|
| 46 | + * @return array<int, int> |
|
| 47 | + */ |
|
| 48 | + public function getErrorList($testFile='ScopeIndentUnitTest.inc') |
|
| 49 | + { |
|
| 50 | + if ($testFile === 'ScopeIndentUnitTest.1.js') { |
|
| 51 | + return [ |
|
| 52 | + 6 => 1, |
|
| 53 | + 14 => 1, |
|
| 54 | + 21 => 1, |
|
| 55 | + 30 => 1, |
|
| 56 | + 32 => 1, |
|
| 57 | + 33 => 1, |
|
| 58 | + 34 => 1, |
|
| 59 | + 39 => 1, |
|
| 60 | + 42 => 1, |
|
| 61 | + 59 => 1, |
|
| 62 | + 60 => 1, |
|
| 63 | + 75 => 1, |
|
| 64 | + 120 => 1, |
|
| 65 | + 121 => 1, |
|
| 66 | + 122 => 1, |
|
| 67 | + 123 => 1, |
|
| 68 | + 141 => 1, |
|
| 69 | + 142 => 1, |
|
| 70 | + 155 => 1, |
|
| 71 | + 156 => 1, |
|
| 72 | + 168 => 1, |
|
| 73 | + 184 => 1, |
|
| 74 | + ]; |
|
| 75 | + }//end if |
|
| 76 | + |
|
| 77 | + if ($testFile === 'ScopeIndentUnitTest.3.inc') { |
|
| 78 | + return [ |
|
| 79 | + 6 => 1, |
|
| 80 | + 7 => 1, |
|
| 81 | + 10 => 1, |
|
| 82 | + ]; |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + if ($testFile === 'ScopeIndentUnitTest.4.inc') { |
|
| 86 | + return []; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + return [ |
|
| 90 | + 7 => 1, |
|
| 91 | + 10 => 1, |
|
| 92 | + 13 => 1, |
|
| 93 | + 17 => 1, |
|
| 94 | + 20 => 1, |
|
| 95 | + 24 => 1, |
|
| 96 | + 25 => 1, |
|
| 97 | + 27 => 1, |
|
| 98 | + 28 => 1, |
|
| 99 | + 29 => 1, |
|
| 100 | + 30 => 1, |
|
| 101 | + 58 => 1, |
|
| 102 | + 123 => 1, |
|
| 103 | + 224 => 1, |
|
| 104 | + 225 => 1, |
|
| 105 | + 279 => 1, |
|
| 106 | + 280 => 1, |
|
| 107 | + 281 => 1, |
|
| 108 | + 282 => 1, |
|
| 109 | + 283 => 1, |
|
| 110 | + 284 => 1, |
|
| 111 | + 285 => 1, |
|
| 112 | + 286 => 1, |
|
| 113 | + 336 => 1, |
|
| 114 | + 349 => 1, |
|
| 115 | + 380 => 1, |
|
| 116 | + 386 => 1, |
|
| 117 | + 387 => 1, |
|
| 118 | + 388 => 1, |
|
| 119 | + 389 => 1, |
|
| 120 | + 390 => 1, |
|
| 121 | + 397 => 1, |
|
| 122 | + 419 => 1, |
|
| 123 | + 420 => 1, |
|
| 124 | + 465 => 1, |
|
| 125 | + 467 => 1, |
|
| 126 | + 472 => 1, |
|
| 127 | + 473 => 1, |
|
| 128 | + 474 => 1, |
|
| 129 | + 496 => 1, |
|
| 130 | + 498 => 1, |
|
| 131 | + 500 => 1, |
|
| 132 | + 524 => 1, |
|
| 133 | + 526 => 1, |
|
| 134 | + 544 => 1, |
|
| 135 | + 545 => 1, |
|
| 136 | + 546 => 1, |
|
| 137 | + 639 => 1, |
|
| 138 | + 660 => 1, |
|
| 139 | + 662 => 1, |
|
| 140 | + 802 => 1, |
|
| 141 | + 803 => 1, |
|
| 142 | + 823 => 1, |
|
| 143 | + 858 => 1, |
|
| 144 | + 879 => 1, |
|
| 145 | + 1163 => 1, |
|
| 146 | + 1197 => 1, |
|
| 147 | + 1198 => 1, |
|
| 148 | + 1259 => 1, |
|
| 149 | + 1264 => 1, |
|
| 150 | + 1265 => 1, |
|
| 151 | + 1266 => 1, |
|
| 152 | + 1269 => 1, |
|
| 153 | + 1272 => 1, |
|
| 154 | + 1273 => 1, |
|
| 155 | + 1274 => 1, |
|
| 156 | + 1275 => 1, |
|
| 157 | + 1276 => 1, |
|
| 158 | + 1277 => 1, |
|
| 159 | + 1280 => 1, |
|
| 160 | + 1281 => 1, |
|
| 161 | + 1282 => 1, |
|
| 162 | + 1284 => 1, |
|
| 163 | + 1285 => 1, |
|
| 164 | + 1288 => 1, |
|
| 165 | + 1289 => 1, |
|
| 166 | + 1290 => 1, |
|
| 167 | + 1292 => 1, |
|
| 168 | + 1293 => 1, |
|
| 169 | + 1310 => 1, |
|
| 170 | + 1312 => 1, |
|
| 171 | + 1327 => 1, |
|
| 172 | + 1328 => 1, |
|
| 173 | + 1329 => 1, |
|
| 174 | + 1330 => 1, |
|
| 175 | + 1331 => 1, |
|
| 176 | + 1332 => 1, |
|
| 177 | + 1335 => 1, |
|
| 178 | + 1340 => 1, |
|
| 179 | + 1342 => 1, |
|
| 180 | + 1345 => 1, |
|
| 181 | + 1488 => 1, |
|
| 182 | + 1489 => 1, |
|
| 183 | + 1500 => 1, |
|
| 184 | + 1503 => 1, |
|
| 185 | + 1518 => 1, |
|
| 186 | + 1520 => 1, |
|
| 187 | + 1527 => 1, |
|
| 188 | + 1529 => 1, |
|
| 189 | + 1530 => 1, |
|
| 190 | + 1567 => 1, |
|
| 191 | + 1568 => 1, |
|
| 192 | + 1569 => 1, |
|
| 193 | + 1570 => 1, |
|
| 194 | + ]; |
|
| 195 | + |
|
| 196 | + }//end getErrorList() |
|
| 197 | + |
|
| 198 | + |
|
| 199 | + /** |
|
| 200 | + * Returns the lines where warnings should occur. |
|
| 201 | + * |
|
| 202 | + * The key of the array should represent the line number and the value |
|
| 203 | + * should represent the number of warnings that should occur on that line. |
|
| 204 | + * |
|
| 205 | + * @return array<int, int> |
|
| 206 | + */ |
|
| 207 | + public function getWarningList() |
|
| 208 | + { |
|
| 209 | + return []; |
|
| 210 | + |
|
| 211 | + }//end getWarningList() |
|
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | }//end class |