@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class DisallowAlternativePHPTagsUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class DisallowAlternativePHPTagsUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -22,8 +21,7 @@ discard block |
||
22 | 21 | * |
23 | 22 | * @return string[] |
24 | 23 | */ |
25 | - protected function getTestFiles($testFileBase) |
|
26 | - { |
|
24 | + protected function getTestFiles($testFileBase) { |
|
27 | 25 | $testFiles = [$testFileBase.'1.inc']; |
28 | 26 | |
29 | 27 | $aspTags = false; |
@@ -52,8 +50,7 @@ discard block |
||
52 | 50 | * |
53 | 51 | * @return array<int, int> |
54 | 52 | */ |
55 | - public function getErrorList($testFile='') |
|
56 | - { |
|
53 | + public function getErrorList($testFile='') { |
|
57 | 54 | switch ($testFile) { |
58 | 55 | case 'DisallowAlternativePHPTagsUnitTest.1.inc': |
59 | 56 | return [ |
@@ -86,8 +83,7 @@ discard block |
||
86 | 83 | * |
87 | 84 | * @return array<int, int> |
88 | 85 | */ |
89 | - public function getWarningList($testFile='') |
|
90 | - { |
|
86 | + public function getWarningList($testFile='') { |
|
91 | 87 | if ($testFile === 'DisallowAlternativePHPTagsUnitTest.3.inc') { |
92 | 88 | return [ |
93 | 89 | 3 => 1, |
@@ -1,14 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // True |
4 | -function myFunction($arg1, $arg2=true) |
|
5 | -{ |
|
4 | +function myFunction($arg1, $arg2=true) { |
|
6 | 5 | } |
7 | -function myFunction($arg1, $arg2=TRUE) |
|
8 | -{ |
|
6 | +function myFunction($arg1, $arg2=TRUE) { |
|
9 | 7 | } |
10 | -function myFunction($arg1, $arg2=True) |
|
11 | -{ |
|
8 | +function myFunction($arg1, $arg2=True) { |
|
12 | 9 | } |
13 | 10 | |
14 | 11 | if ($variable === true) { } |
@@ -17,14 +14,11 @@ discard block |
||
17 | 14 | |
18 | 15 | |
19 | 16 | // False |
20 | -function myFunction($arg1, $arg2=false) |
|
21 | -{ |
|
17 | +function myFunction($arg1, $arg2=false) { |
|
22 | 18 | } |
23 | -function myFunction($arg1, $arg2=FALSE) |
|
24 | -{ |
|
19 | +function myFunction($arg1, $arg2=FALSE) { |
|
25 | 20 | } |
26 | -function myFunction($arg1, $arg2=False) |
|
27 | -{ |
|
21 | +function myFunction($arg1, $arg2=False) { |
|
28 | 22 | } |
29 | 23 | |
30 | 24 | if ($variable === false) { } |
@@ -33,14 +27,11 @@ discard block |
||
33 | 27 | |
34 | 28 | |
35 | 29 | // Null |
36 | -function myFunction($arg1, $arg2=null) |
|
37 | -{ |
|
30 | +function myFunction($arg1, $arg2=null) { |
|
38 | 31 | } |
39 | -function myFunction($arg1, $arg2=NULL) |
|
40 | -{ |
|
32 | +function myFunction($arg1, $arg2=NULL) { |
|
41 | 33 | } |
42 | -function myFunction($arg1, $arg2=Null) |
|
43 | -{ |
|
34 | +function myFunction($arg1, $arg2=Null) { |
|
44 | 35 | } |
45 | 36 | |
46 | 37 | if ($variable === null) { } |
@@ -59,10 +50,8 @@ discard block |
||
59 | 50 | |
60 | 51 | use True\Something; |
61 | 52 | use Something\True; |
62 | -class MyClass |
|
63 | -{ |
|
64 | - public function myFunction() |
|
65 | - { |
|
53 | +class MyClass { |
|
54 | + public function myFunction() { |
|
66 | 55 | $var = array('foo' => new True()); |
67 | 56 | } |
68 | 57 | } |
@@ -70,8 +59,7 @@ discard block |
||
70 | 59 | $x = $f?FALSE:true; |
71 | 60 | $x = $f? FALSE:true; |
72 | 61 | |
73 | -class MyClass |
|
74 | -{ |
|
62 | +class MyClass { |
|
75 | 63 | // Spice things up a little. |
76 | 64 | const TRUE = false; |
77 | 65 | } |
@@ -22,22 +22,4 @@ |
||
22 | 22 | <<<<<<< HEAD |
23 | 23 | $a = 1; |
24 | 24 | ======= |
25 | -$a = 2; |
|
26 | ->>>>>>> master |
|
27 | - |
|
28 | -/* |
|
29 | - * The above tests are based on "normal" tokens. |
|
30 | - * The below test checks that once the tokenizer breaks down because of |
|
31 | - * unexpected merge conflict boundaries - i.e. after the first merge conflict |
|
32 | - * opener in non-comment, non-heredoc/nowdoc, non-inline HTML code -, subsequent |
|
33 | - * merge conflict boundaries will still be detected correctly. |
|
34 | - */ |
|
35 | -?> |
|
36 | - |
|
37 | -<div class="abc"> |
|
38 | -<<<<<<< HEAD |
|
39 | - <p id="test-this">Testing a merge conflict.</p> |
|
40 | -======= |
|
41 | - <p id="test-that">Another text string.</p> |
|
42 | ->>>>>>> ref/heads/feature-branch |
|
43 | -</div> |
|
25 | +$a |
|
44 | 26 | \ No newline at end of file |
@@ -64,8 +64,4 @@ |
||
64 | 64 | <<<<<<< HEAD |
65 | 65 | can be problematic. |
66 | 66 | EOD; |
67 | -$a = 1; |
|
68 | -======= |
|
69 | -should also be detected. |
|
70 | -EOT; |
|
71 | ->>>>>>> ref/heads/other-branchname |
|
67 | +$a |
|
72 | 68 | \ No newline at end of file |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class GitMergeConflictUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class GitMergeConflictUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -25,8 +24,7 @@ discard block |
||
25 | 24 | * |
26 | 25 | * @return array<int, int> |
27 | 26 | */ |
28 | - public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') |
|
29 | - { |
|
27 | + public function getErrorList($testFile='GitMergeConflictUnitTest.1.inc') { |
|
30 | 28 | switch ($testFile) { |
31 | 29 | case 'GitMergeConflictUnitTest.1.inc': |
32 | 30 | return [ |
@@ -150,8 +148,7 @@ discard block |
||
150 | 148 | * |
151 | 149 | * @return array<int, int> |
152 | 150 | */ |
153 | - public function getWarningList() |
|
154 | - { |
|
151 | + public function getWarningList() { |
|
155 | 152 | return []; |
156 | 153 | |
157 | 154 | }//end getWarningList() |
@@ -22,13 +22,4 @@ |
||
22 | 22 | * merge conflict boundaries will still be detected correctly. |
23 | 23 | */ |
24 | 24 | |
25 | -$string = |
|
26 | - <<<"EOD" |
|
27 | - Merge conflicts in PHP 7.3 indented heredocs |
|
28 | -<<<<<<< HEAD |
|
29 | - can be problematic. |
|
30 | -======= |
|
31 | - should also be detected. |
|
32 | ->>>>>>> ref/heads/other-branchname |
|
33 | - And now they are. |
|
34 | - EOD; |
|
25 | +$string |
|
35 | 26 | \ No newline at end of file |
@@ -24,8 +24,3 @@ |
||
24 | 24 | |
25 | 25 | // Comment |
26 | 26 | <<<<<<< HEAD |
27 | -// Second comment line. NOTE: The above opener breaks the tokenizer. |
|
28 | -======= |
|
29 | -// New second comment line |
|
30 | ->>>>>>> master |
|
31 | -// Third comment line |
@@ -22,13 +22,4 @@ |
||
22 | 22 | * merge conflict boundaries will still be detected correctly. |
23 | 23 | */ |
24 | 24 | |
25 | -$string = |
|
26 | -<<<'EOD' |
|
27 | -can be problematic. |
|
28 | -<<<<<<< HEAD |
|
29 | -were previously not detected. |
|
30 | -======= |
|
31 | -should also be detected. |
|
32 | ->>>>>>> ref/heads/other-branchname |
|
33 | -And now they are. |
|
34 | -EOD; |
|
25 | +$string |
|
35 | 26 | \ No newline at end of file |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; |
13 | 13 | |
14 | -class SubversionPropertiesUnitTest extends AbstractSniffUnitTest |
|
15 | -{ |
|
14 | +class SubversionPropertiesUnitTest extends AbstractSniffUnitTest { |
|
16 | 15 | |
17 | 16 | |
18 | 17 | /** |
@@ -20,8 +19,7 @@ discard block |
||
20 | 19 | * |
21 | 20 | * @return void |
22 | 21 | */ |
23 | - protected function shouldSkipTest() |
|
24 | - { |
|
22 | + protected function shouldSkipTest() { |
|
25 | 23 | // This sniff cannot be tested as no SVN version control directory is available. |
26 | 24 | return true; |
27 | 25 | |
@@ -36,8 +34,7 @@ discard block |
||
36 | 34 | * |
37 | 35 | * @return array<int, int> |
38 | 36 | */ |
39 | - public function getErrorList() |
|
40 | - { |
|
37 | + public function getErrorList() { |
|
41 | 38 | return []; |
42 | 39 | |
43 | 40 | }//end getErrorList() |
@@ -51,8 +48,7 @@ discard block |
||
51 | 48 | * |
52 | 49 | * @return array<int, int> |
53 | 50 | */ |
54 | - public function getWarningList() |
|
55 | - { |
|
51 | + public function getWarningList() { |
|
56 | 52 | return []; |
57 | 53 | |
58 | 54 | }//end getWarningList() |