@@ -57,5 +57,4 @@ |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ No newline at end of file |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | function test() |
23 | - { |
|
24 | - $arr = array( |
|
25 | - 'a' => 'a' |
|
23 | + { |
|
24 | + $arr = array( |
|
25 | + 'a' => 'a' |
|
26 | 26 | <<<<<<< HEAD |
27 | 27 | 'b' => 'b' |
28 | 28 | ======= |
@@ -57,5 +57,4 @@ discard block |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ No newline at end of file |
@@ -57,5 +57,4 @@ |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ No newline at end of file |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -var_dump(1 << -1); |
|
4 | -var_dump(1 >> -1); |
|
3 | +var_dump( 1 << -1 ); |
|
4 | +var_dump( 1 >> -1 ); |
|
5 | 5 | var_dump( |
6 | 6 | 1 |
7 | 7 | << |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | { |
24 | 24 | $arr = array( |
25 | 25 | 'a' => 'a' |
26 | -<<<<<<< HEAD |
|
26 | +<< << <<< HEAD |
|
27 | 27 | 'b' => 'b' |
28 | 28 | ======= |
29 | 29 | 'c' => 'c' |
@@ -57,5 +57,4 @@ discard block |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ No newline at end of file |
@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | * <<<<<<< HEAD |
20 | 20 | */ |
21 | 21 | |
22 | -function test() |
|
23 | - { |
|
22 | +function test() { |
|
24 | 23 | $arr = array( |
25 | 24 | 'a' => 'a' |
26 | 25 | <<<<<<< HEAD |
@@ -57,5 +56,4 @@ discard block |
||
57 | 56 | |
58 | 57 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 58 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
59 | +$a |
|
62 | 60 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $string = |
12 | 12 | <<<EOD |
13 | 13 | This is a heredoc. |
14 | -EOD; |
|
14 | +eod; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * This is not a merge conflict, but a comment showing what |
@@ -57,5 +57,4 @@ discard block |
||
57 | 57 | |
58 | 58 | // Test that stray boundaries, i.e. an opener without closer and such, are detected. |
59 | 59 | <<<<<<< HEAD |
60 | -$a = 1; |
|
61 | -======= |
|
60 | +$a |
|
62 | 61 | \ 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 |
@@ -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 |
@@ -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 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <<<<<<< HEAD |
15 | 15 | * @var string $bar |
16 | 16 | */ |
17 | -public function foo($bar){ } |
|
17 | +public function foo( $bar ) { } |
|
18 | 18 | |
19 | 19 | /* |
20 | 20 | ======= |
@@ -23,9 +23,4 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | // Comment |
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 |
|
26 | +<< << <<< HEAD |
@@ -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 |
@@ -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,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 |
@@ -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 |
@@ -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 |
@@ -19,25 +19,7 @@ |
||
19 | 19 | <?php |
20 | 20 | |
21 | 21 | // Break the tokenizer. |
22 | -<<<<<<< HEAD |
|
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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | ======= |
23 | 23 | should also be detected. |
24 | 24 | EOT; |
25 | ->>>>>>> ref/heads/other-branchname |
|
25 | +>> >> >> > ref / heads / other - branchname |
|
26 | 26 | |
27 | 27 | // Merge conflict starter outside with a closer inside of the heredoc. |
28 | 28 | // This breaks the tokenizer. |
29 | -<<<<<<< HEAD |
|
29 | +<< << <<< HEAD |
|
30 | 30 | $string = |
31 | 31 | <<<EOT |
32 | 32 | Merge conflicts in heredocs |
@@ -64,8 +64,4 @@ discard block |
||
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 |
@@ -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 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | should also be detected. |
10 | 10 | >>>>>>> ref/heads/other-branchname |
11 | 11 | And now they are. |
12 | -EOD; |
|
12 | +eod; |
|
13 | 13 | |
14 | 14 | // Heredoc with a merge conflict starter, the closer is outside the heredoc. |
15 | 15 | $string = |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $a = 1; |
22 | 22 | ======= |
23 | 23 | should also be detected. |
24 | -EOT; |
|
24 | +eot; |
|
25 | 25 | >>>>>>> ref/heads/other-branchname |
26 | 26 | |
27 | 27 | // Merge conflict starter outside with a closer inside of the heredoc. |
@@ -64,8 +64,4 @@ discard block |
||
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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | EOD; |
13 | 13 | |
14 | 14 | // Break the tokenizer. |
15 | -<<<<<<< HEAD |
|
15 | +<< << <<< HEAD |
|
16 | 16 | |
17 | 17 | /* |
18 | 18 | * The above tests are based on "normal" tokens. |
@@ -22,13 +22,4 @@ discard block |
||
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 |
@@ -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 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | should also be detected. |
10 | 10 | >>>>>>> ref/heads/other-branchname |
11 | 11 | And now they are. |
12 | -EOD; |
|
12 | +eod; |
|
13 | 13 | |
14 | 14 | // Break the tokenizer. |
15 | 15 | <<<<<<< HEAD |
@@ -22,13 +22,4 @@ discard block |
||
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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * Returns an array of tokens this test wants to listen for. |
21 | 21 | * |
22 | - * @return array |
|
22 | + * @return integer[] |
|
23 | 23 | */ |
24 | 24 | public function register() |
25 | 25 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param int $stackPtr The position in the tokens array of the |
83 | 83 | * potentially included class. |
84 | 84 | * |
85 | - * @return string |
|
85 | + * @return boolean |
|
86 | 86 | */ |
87 | 87 | protected function getIncludedClassFromToken( |
88 | 88 | $phpcsFile, |
@@ -16,83 +16,83 @@ |
||
16 | 16 | { |
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * Returns an array of tokens this test wants to listen for. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function register() |
|
25 | - { |
|
26 | - return [T_DOUBLE_COLON]; |
|
27 | - |
|
28 | - }//end register() |
|
29 | - |
|
30 | - |
|
31 | - /** |
|
32 | - * Processes this sniff, when one of its tokens is encountered. |
|
33 | - * |
|
34 | - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. |
|
35 | - * @param int $stackPtr The position of the current token in |
|
36 | - * the stack passed in $tokens. |
|
37 | - * |
|
38 | - * @return void |
|
39 | - */ |
|
40 | - public function process(File $phpcsFile, $stackPtr) |
|
41 | - { |
|
42 | - $fileName = $phpcsFile->getFilename(); |
|
43 | - $matches = []; |
|
44 | - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { |
|
45 | - // Not an actions file. |
|
46 | - return; |
|
47 | - } |
|
48 | - |
|
49 | - $ownClass = $matches[2]; |
|
50 | - $tokens = $phpcsFile->getTokens(); |
|
51 | - |
|
52 | - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); |
|
53 | - $typeName = trim($tokens[$typeName]['content'], " '"); |
|
54 | - switch (strtolower($tokens[($stackPtr + 1)]['content'])) { |
|
55 | - case 'includesystem' : |
|
56 | - $included = strtolower($typeName); |
|
57 | - break; |
|
58 | - case 'includeasset' : |
|
59 | - $included = strtolower($typeName).'assettype'; |
|
60 | - break; |
|
61 | - case 'includewidget' : |
|
62 | - $included = strtolower($typeName).'widgettype'; |
|
63 | - break; |
|
64 | - default: |
|
65 | - return; |
|
66 | - } |
|
67 | - |
|
68 | - if ($included === strtolower($ownClass)) { |
|
69 | - $error = "You do not need to include \"%s\" from within the system's own actions file"; |
|
70 | - $data = [$ownClass]; |
|
71 | - $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); |
|
72 | - } |
|
73 | - |
|
74 | - }//end process() |
|
75 | - |
|
76 | - |
|
77 | - /** |
|
78 | - * Determines the included class name from given token. |
|
79 | - * |
|
80 | - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. |
|
81 | - * @param array $tokens The array of file tokens. |
|
82 | - * @param int $stackPtr The position in the tokens array of the |
|
83 | - * potentially included class. |
|
84 | - * |
|
85 | - * @return string |
|
86 | - */ |
|
87 | - protected function getIncludedClassFromToken( |
|
88 | - $phpcsFile, |
|
89 | - array $tokens, |
|
90 | - $stackPtr |
|
91 | - ) { |
|
92 | - |
|
93 | - return false; |
|
94 | - |
|
95 | - }//end getIncludedClassFromToken() |
|
19 | + /** |
|
20 | + * Returns an array of tokens this test wants to listen for. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function register() |
|
25 | + { |
|
26 | + return [T_DOUBLE_COLON]; |
|
27 | + |
|
28 | + }//end register() |
|
29 | + |
|
30 | + |
|
31 | + /** |
|
32 | + * Processes this sniff, when one of its tokens is encountered. |
|
33 | + * |
|
34 | + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. |
|
35 | + * @param int $stackPtr The position of the current token in |
|
36 | + * the stack passed in $tokens. |
|
37 | + * |
|
38 | + * @return void |
|
39 | + */ |
|
40 | + public function process(File $phpcsFile, $stackPtr) |
|
41 | + { |
|
42 | + $fileName = $phpcsFile->getFilename(); |
|
43 | + $matches = []; |
|
44 | + if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { |
|
45 | + // Not an actions file. |
|
46 | + return; |
|
47 | + } |
|
48 | + |
|
49 | + $ownClass = $matches[2]; |
|
50 | + $tokens = $phpcsFile->getTokens(); |
|
51 | + |
|
52 | + $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); |
|
53 | + $typeName = trim($tokens[$typeName]['content'], " '"); |
|
54 | + switch (strtolower($tokens[($stackPtr + 1)]['content'])) { |
|
55 | + case 'includesystem' : |
|
56 | + $included = strtolower($typeName); |
|
57 | + break; |
|
58 | + case 'includeasset' : |
|
59 | + $included = strtolower($typeName).'assettype'; |
|
60 | + break; |
|
61 | + case 'includewidget' : |
|
62 | + $included = strtolower($typeName).'widgettype'; |
|
63 | + break; |
|
64 | + default: |
|
65 | + return; |
|
66 | + } |
|
67 | + |
|
68 | + if ($included === strtolower($ownClass)) { |
|
69 | + $error = "You do not need to include \"%s\" from within the system's own actions file"; |
|
70 | + $data = [$ownClass]; |
|
71 | + $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); |
|
72 | + } |
|
73 | + |
|
74 | + }//end process() |
|
75 | + |
|
76 | + |
|
77 | + /** |
|
78 | + * Determines the included class name from given token. |
|
79 | + * |
|
80 | + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found. |
|
81 | + * @param array $tokens The array of file tokens. |
|
82 | + * @param int $stackPtr The position in the tokens array of the |
|
83 | + * potentially included class. |
|
84 | + * |
|
85 | + * @return string |
|
86 | + */ |
|
87 | + protected function getIncludedClassFromToken( |
|
88 | + $phpcsFile, |
|
89 | + array $tokens, |
|
90 | + $stackPtr |
|
91 | + ) { |
|
92 | + |
|
93 | + return false; |
|
94 | + |
|
95 | + }//end getIncludedClassFromToken() |
|
96 | 96 | |
97 | 97 | |
98 | 98 | }//end class |
@@ -52,17 +52,17 @@ |
||
52 | 52 | $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); |
53 | 53 | $typeName = trim($tokens[$typeName]['content'], " '"); |
54 | 54 | switch (strtolower($tokens[($stackPtr + 1)]['content'])) { |
55 | - case 'includesystem' : |
|
56 | - $included = strtolower($typeName); |
|
57 | - break; |
|
58 | - case 'includeasset' : |
|
59 | - $included = strtolower($typeName).'assettype'; |
|
60 | - break; |
|
61 | - case 'includewidget' : |
|
62 | - $included = strtolower($typeName).'widgettype'; |
|
63 | - break; |
|
64 | - default: |
|
65 | - return; |
|
55 | + case 'includesystem' : |
|
56 | + $included = strtolower($typeName); |
|
57 | + break; |
|
58 | + case 'includeasset' : |
|
59 | + $included = strtolower($typeName).'assettype'; |
|
60 | + break; |
|
61 | + case 'includewidget' : |
|
62 | + $included = strtolower($typeName).'widgettype'; |
|
63 | + break; |
|
64 | + default: |
|
65 | + return; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($included === strtolower($ownClass)) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function register() |
25 | 25 | { |
26 | - return [T_DOUBLE_COLON]; |
|
26 | + return [ T_DOUBLE_COLON ]; |
|
27 | 27 | |
28 | 28 | }//end register() |
29 | 29 | |
@@ -37,38 +37,38 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @return void |
39 | 39 | */ |
40 | - public function process(File $phpcsFile, $stackPtr) |
|
40 | + public function process( File $phpcsFile, $stackPtr ) |
|
41 | 41 | { |
42 | 42 | $fileName = $phpcsFile->getFilename(); |
43 | - $matches = []; |
|
44 | - if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { |
|
43 | + $matches = [ ]; |
|
44 | + if ( preg_match( '|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches ) === 0 ) { |
|
45 | 45 | // Not an actions file. |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
49 | - $ownClass = $matches[2]; |
|
49 | + $ownClass = $matches[ 2 ]; |
|
50 | 50 | $tokens = $phpcsFile->getTokens(); |
51 | 51 | |
52 | - $typeName = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, ($stackPtr + 2), null, false, true); |
|
53 | - $typeName = trim($tokens[$typeName]['content'], " '"); |
|
54 | - switch (strtolower($tokens[($stackPtr + 1)]['content'])) { |
|
52 | + $typeName = $phpcsFile->findNext( T_CONSTANT_ENCAPSED_STRING, ( $stackPtr + 2 ), null, false, true ); |
|
53 | + $typeName = trim( $tokens[ $typeName ][ 'content' ], " '" ); |
|
54 | + switch ( strtolower( $tokens[ ( $stackPtr + 1 ) ][ 'content' ] ) ) { |
|
55 | 55 | case 'includesystem' : |
56 | - $included = strtolower($typeName); |
|
56 | + $included = strtolower( $typeName ); |
|
57 | 57 | break; |
58 | 58 | case 'includeasset' : |
59 | - $included = strtolower($typeName).'assettype'; |
|
59 | + $included = strtolower( $typeName ) . 'assettype'; |
|
60 | 60 | break; |
61 | 61 | case 'includewidget' : |
62 | - $included = strtolower($typeName).'widgettype'; |
|
62 | + $included = strtolower( $typeName ) . 'widgettype'; |
|
63 | 63 | break; |
64 | 64 | default: |
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | - if ($included === strtolower($ownClass)) { |
|
68 | + if ( $included === strtolower( $ownClass ) ) { |
|
69 | 69 | $error = "You do not need to include \"%s\" from within the system's own actions file"; |
70 | - $data = [$ownClass]; |
|
71 | - $phpcsFile->addError($error, $stackPtr, 'NotRequired', $data); |
|
70 | + $data = [ $ownClass ]; |
|
71 | + $phpcsFile->addError( $error, $stackPtr, 'NotRequired', $data ); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | }//end process() |
@@ -12,8 +12,7 @@ discard block |
||
12 | 12 | use PHP_CodeSniffer\Sniffs\Sniff; |
13 | 13 | use PHP_CodeSniffer\Files\File; |
14 | 14 | |
15 | -class IncludeOwnSystemSniff implements Sniff |
|
16 | -{ |
|
15 | +class IncludeOwnSystemSniff implements Sniff { |
|
17 | 16 | |
18 | 17 | |
19 | 18 | /** |
@@ -21,8 +20,7 @@ discard block |
||
21 | 20 | * |
22 | 21 | * @return array |
23 | 22 | */ |
24 | - public function register() |
|
25 | - { |
|
23 | + public function register() { |
|
26 | 24 | return [T_DOUBLE_COLON]; |
27 | 25 | |
28 | 26 | }//end register() |
@@ -37,8 +35,7 @@ discard block |
||
37 | 35 | * |
38 | 36 | * @return void |
39 | 37 | */ |
40 | - public function process(File $phpcsFile, $stackPtr) |
|
41 | - { |
|
38 | + public function process(File $phpcsFile, $stackPtr) { |
|
42 | 39 | $fileName = $phpcsFile->getFilename(); |
43 | 40 | $matches = []; |
44 | 41 | if (preg_match('|/systems/(.*)/([^/]+)?actions.inc$|i', $fileName, $matches) === 0) { |
@@ -35,6 +35,9 @@ |
||
35 | 35 | |
36 | 36 | abstract class AbstractEditingScreenModeWidgetActions extends AbstractEditingModeWidgetActions { |
37 | 37 | |
38 | + /** |
|
39 | + * @param string $systemName |
|
40 | + */ |
|
38 | 41 | public static function getScreens($systemName) |
39 | 42 | { |
40 | 43 |
@@ -2,50 +2,50 @@ |
||
2 | 2 | class SomethingActions |
3 | 3 | { |
4 | 4 | |
5 | - private static function _x() |
|
6 | - { |
|
7 | - } |
|
8 | - |
|
9 | - |
|
10 | - public static function y() |
|
11 | - { |
|
12 | - self::z(); |
|
13 | - static::z(); |
|
14 | - SomethingActions::z(); |
|
15 | - static::_x(); |
|
16 | - self::a(); |
|
17 | - static::a(); |
|
18 | - } |
|
19 | - |
|
20 | - |
|
21 | - public static function z() |
|
22 | - { |
|
23 | - } |
|
24 | - |
|
25 | - protected static function a() |
|
26 | - { |
|
27 | - self::a(); // recursion, yay! |
|
28 | - self::z(); |
|
29 | - static::y(); |
|
30 | - self::b(); |
|
31 | - echo self::$_myVar; |
|
32 | - echo static::$yourVar; |
|
33 | - } |
|
5 | + private static function _x() |
|
6 | + { |
|
7 | + } |
|
8 | + |
|
9 | + |
|
10 | + public static function y() |
|
11 | + { |
|
12 | + self::z(); |
|
13 | + static::z(); |
|
14 | + SomethingActions::z(); |
|
15 | + static::_x(); |
|
16 | + self::a(); |
|
17 | + static::a(); |
|
18 | + } |
|
19 | + |
|
20 | + |
|
21 | + public static function z() |
|
22 | + { |
|
23 | + } |
|
24 | + |
|
25 | + protected static function a() |
|
26 | + { |
|
27 | + self::a(); // recursion, yay! |
|
28 | + self::z(); |
|
29 | + static::y(); |
|
30 | + self::b(); |
|
31 | + echo self::$_myVar; |
|
32 | + echo static::$yourVar; |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | abstract class AbstractEditingScreenModeWidgetActions extends AbstractEditingModeWidgetActions { |
37 | 37 | |
38 | - public static function getScreens($systemName) |
|
39 | - { |
|
38 | + public static function getScreens($systemName) |
|
39 | + { |
|
40 | 40 | |
41 | - }//end getScreens() |
|
41 | + }//end getScreens() |
|
42 | 42 | |
43 | - public static function setHelpScreenTitle() |
|
44 | - { |
|
45 | - // This is allowed because we are in an abstract class. |
|
46 | - $screens = self::getScreens(''); |
|
43 | + public static function setHelpScreenTitle() |
|
44 | + { |
|
45 | + // This is allowed because we are in an abstract class. |
|
46 | + $screens = self::getScreens(''); |
|
47 | 47 | |
48 | - }//end setHelpScreenTitle() |
|
48 | + }//end setHelpScreenTitle() |
|
49 | 49 | |
50 | 50 | }//end class |
51 | 51 | ?> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | abstract class AbstractEditingScreenModeWidgetActions extends AbstractEditingModeWidgetActions { |
37 | 37 | |
38 | - public static function getScreens($systemName) |
|
38 | + public static function getScreens( $systemName ) |
|
39 | 39 | { |
40 | 40 | |
41 | 41 | }//end getScreens() |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public static function setHelpScreenTitle() |
44 | 44 | { |
45 | 45 | // This is allowed because we are in an abstract class. |
46 | - $screens = self::getScreens(''); |
|
46 | + $screens = self::getScreens( '' ); |
|
47 | 47 | |
48 | 48 | }//end setHelpScreenTitle() |
49 | 49 |
@@ -1,14 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -class SomethingActions |
|
3 | -{ |
|
2 | +class SomethingActions { |
|
4 | 3 | |
5 | - private static function _x() |
|
6 | - { |
|
4 | + private static function _x() { |
|
7 | 5 | } |
8 | 6 | |
9 | 7 | |
10 | - public static function y() |
|
11 | - { |
|
8 | + public static function y() { |
|
12 | 9 | self::z(); |
13 | 10 | static::z(); |
14 | 11 | SomethingActions::z(); |
@@ -18,12 +15,10 @@ discard block |
||
18 | 15 | } |
19 | 16 | |
20 | 17 | |
21 | - public static function z() |
|
22 | - { |
|
18 | + public static function z() { |
|
23 | 19 | } |
24 | 20 | |
25 | - protected static function a() |
|
26 | - { |
|
21 | + protected static function a() { |
|
27 | 22 | self::a(); // recursion, yay! |
28 | 23 | self::z(); |
29 | 24 | static::y(); |
@@ -35,13 +30,11 @@ discard block |
||
35 | 30 | |
36 | 31 | abstract class AbstractEditingScreenModeWidgetActions extends AbstractEditingModeWidgetActions { |
37 | 32 | |
38 | - public static function getScreens($systemName) |
|
39 | - { |
|
33 | + public static function getScreens($systemName) { |
|
40 | 34 | |
41 | 35 | }//end getScreens() |
42 | 36 | |
43 | - public static function setHelpScreenTitle() |
|
44 | - { |
|
37 | + public static function setHelpScreenTitle() { |
|
45 | 38 | // This is allowed because we are in an abstract class. |
46 | 39 | $screens = self::getScreens(''); |
47 | 40 |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | * |
10 | 10 | * @param int $stackPtr The position in @ @unknown the stack of the token |
11 | 11 | * that opened the scope |
12 | - * @param int $detph How many scope levels down we are. |
|
12 | + * @param int $depth How many scope levels down we are. |
|
13 | 13 | * @param int $index The index |
14 | 14 | * @return |
15 | - * @throws |
|
15 | + integer @throws |
|
16 | 16 | */ |
17 | 17 | private function _functionCall($stackPtr, $depth=1, $index) |
18 | 18 | { |
@@ -121,7 +121,6 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return |
123 | 123 | * @param int $threeSpaces |
124 | - * @param int $superfluous |
|
125 | 124 | * @param missing |
126 | 125 | * @param |
127 | 126 | */ |
@@ -2,148 +2,148 @@ discard block |
||
2 | 2 | class PHP_CodeSniffer_File |
3 | 3 | { |
4 | 4 | |
5 | - /** |
|
6 | - * A simple function comment. |
|
7 | - * |
|
8 | - * long desc here |
|
9 | - * |
|
10 | - * @param int $stackPtr The position in @ @unknown the stack of the token |
|
11 | - * that opened the scope |
|
12 | - * @param int $detph How many scope levels down we are. |
|
13 | - * @param int $index The index |
|
14 | - * @return |
|
15 | - * @throws |
|
16 | - */ |
|
17 | - private function _functionCall($stackPtr, $depth=1, $index) |
|
18 | - { |
|
19 | - return $stackPtr; |
|
20 | - |
|
21 | - }//end _functionCall() |
|
22 | - |
|
23 | - // |
|
24 | - // Sample function comment |
|
25 | - // |
|
26 | - // |
|
27 | - // |
|
28 | - public function invalidCommentStyle() |
|
29 | - { |
|
30 | - |
|
31 | - }//end invalidCommentStyle() |
|
32 | - |
|
33 | - |
|
34 | - /** |
|
35 | - * |
|
36 | - * |
|
37 | - * A simple function comment |
|
38 | - * |
|
39 | - * |
|
40 | - * Long description with extra blank line before and after |
|
41 | - * |
|
42 | - * |
|
43 | - * @return void |
|
44 | - */ |
|
45 | - public function extraDescriptionNewlines() |
|
46 | - { |
|
47 | - |
|
48 | - }//end extraDescriptionNewlines() |
|
49 | - |
|
50 | - |
|
51 | - /** |
|
52 | - * A simple function comment |
|
53 | - * @return void |
|
54 | - */ |
|
55 | - public function missingNewlinesBeforeTags() |
|
56 | - { |
|
57 | - |
|
58 | - }//end missingNewlinesBeforeTags() |
|
59 | - |
|
60 | - |
|
61 | - /** |
|
62 | - * Access tag should not be treated as a long description |
|
63 | - * |
|
64 | - * @access public |
|
65 | - * @return void |
|
66 | - */ |
|
67 | - public function accessTag() |
|
68 | - { |
|
69 | - |
|
70 | - }//end accessTag() |
|
71 | - |
|
72 | - /** |
|
73 | - * Constructor |
|
74 | - * |
|
75 | - * No return tag |
|
76 | - */ |
|
77 | - function PHP_CodeSniffer_File() |
|
78 | - { |
|
79 | - return; |
|
80 | - } |
|
81 | - |
|
82 | - |
|
83 | - /** |
|
84 | - * Destructor |
|
85 | - * |
|
86 | - * No return tag too |
|
87 | - */ |
|
88 | - function _PHP_CodeSniffer_File() |
|
89 | - { |
|
90 | - return; |
|
91 | - } |
|
92 | - |
|
93 | - |
|
94 | - /** |
|
95 | - * Destructor PHP5 |
|
96 | - */ |
|
97 | - function __destruct() |
|
98 | - { |
|
99 | - return; |
|
100 | - } |
|
101 | - |
|
102 | - |
|
103 | - function missingComment() |
|
104 | - { |
|
105 | - return; |
|
106 | - } |
|
107 | - |
|
108 | - |
|
109 | - /** |
|
110 | - * no return tag |
|
111 | - * |
|
112 | - */ |
|
113 | - public function noReturn($one) |
|
114 | - { |
|
115 | - |
|
116 | - }//end noReturn() |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * Param not immediate |
|
121 | - * |
|
122 | - * @return |
|
123 | - * @param int $threeSpaces |
|
124 | - * @param int $superfluous |
|
125 | - * @param missing |
|
126 | - * @param |
|
127 | - */ |
|
128 | - public function missingDescription($threeSpaces) |
|
129 | - { |
|
130 | - |
|
131 | - }//end missingDescription() |
|
132 | - |
|
133 | - |
|
134 | - /** |
|
135 | - * Param not immediate |
|
136 | - * |
|
137 | - * @param int $one comment |
|
138 | - * @param int $two comment |
|
139 | - * @param string $three comment |
|
140 | - * |
|
141 | - * @return void |
|
142 | - */ |
|
143 | - public function oneSpaceAfterLongestVar($one, $two, $three) |
|
144 | - { |
|
145 | - |
|
146 | - }//end oneSpaceAfterLongestVar() |
|
5 | + /** |
|
6 | + * A simple function comment. |
|
7 | + * |
|
8 | + * long desc here |
|
9 | + * |
|
10 | + * @param int $stackPtr The position in @ @unknown the stack of the token |
|
11 | + * that opened the scope |
|
12 | + * @param int $detph How many scope levels down we are. |
|
13 | + * @param int $index The index |
|
14 | + * @return |
|
15 | + * @throws |
|
16 | + */ |
|
17 | + private function _functionCall($stackPtr, $depth=1, $index) |
|
18 | + { |
|
19 | + return $stackPtr; |
|
20 | + |
|
21 | + }//end _functionCall() |
|
22 | + |
|
23 | + // |
|
24 | + // Sample function comment |
|
25 | + // |
|
26 | + // |
|
27 | + // |
|
28 | + public function invalidCommentStyle() |
|
29 | + { |
|
30 | + |
|
31 | + }//end invalidCommentStyle() |
|
32 | + |
|
33 | + |
|
34 | + /** |
|
35 | + * |
|
36 | + * |
|
37 | + * A simple function comment |
|
38 | + * |
|
39 | + * |
|
40 | + * Long description with extra blank line before and after |
|
41 | + * |
|
42 | + * |
|
43 | + * @return void |
|
44 | + */ |
|
45 | + public function extraDescriptionNewlines() |
|
46 | + { |
|
47 | + |
|
48 | + }//end extraDescriptionNewlines() |
|
49 | + |
|
50 | + |
|
51 | + /** |
|
52 | + * A simple function comment |
|
53 | + * @return void |
|
54 | + */ |
|
55 | + public function missingNewlinesBeforeTags() |
|
56 | + { |
|
57 | + |
|
58 | + }//end missingNewlinesBeforeTags() |
|
59 | + |
|
60 | + |
|
61 | + /** |
|
62 | + * Access tag should not be treated as a long description |
|
63 | + * |
|
64 | + * @access public |
|
65 | + * @return void |
|
66 | + */ |
|
67 | + public function accessTag() |
|
68 | + { |
|
69 | + |
|
70 | + }//end accessTag() |
|
71 | + |
|
72 | + /** |
|
73 | + * Constructor |
|
74 | + * |
|
75 | + * No return tag |
|
76 | + */ |
|
77 | + function PHP_CodeSniffer_File() |
|
78 | + { |
|
79 | + return; |
|
80 | + } |
|
81 | + |
|
82 | + |
|
83 | + /** |
|
84 | + * Destructor |
|
85 | + * |
|
86 | + * No return tag too |
|
87 | + */ |
|
88 | + function _PHP_CodeSniffer_File() |
|
89 | + { |
|
90 | + return; |
|
91 | + } |
|
92 | + |
|
93 | + |
|
94 | + /** |
|
95 | + * Destructor PHP5 |
|
96 | + */ |
|
97 | + function __destruct() |
|
98 | + { |
|
99 | + return; |
|
100 | + } |
|
101 | + |
|
102 | + |
|
103 | + function missingComment() |
|
104 | + { |
|
105 | + return; |
|
106 | + } |
|
107 | + |
|
108 | + |
|
109 | + /** |
|
110 | + * no return tag |
|
111 | + * |
|
112 | + */ |
|
113 | + public function noReturn($one) |
|
114 | + { |
|
115 | + |
|
116 | + }//end noReturn() |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * Param not immediate |
|
121 | + * |
|
122 | + * @return |
|
123 | + * @param int $threeSpaces |
|
124 | + * @param int $superfluous |
|
125 | + * @param missing |
|
126 | + * @param |
|
127 | + */ |
|
128 | + public function missingDescription($threeSpaces) |
|
129 | + { |
|
130 | + |
|
131 | + }//end missingDescription() |
|
132 | + |
|
133 | + |
|
134 | + /** |
|
135 | + * Param not immediate |
|
136 | + * |
|
137 | + * @param int $one comment |
|
138 | + * @param int $two comment |
|
139 | + * @param string $three comment |
|
140 | + * |
|
141 | + * @return void |
|
142 | + */ |
|
143 | + public function oneSpaceAfterLongestVar($one, $two, $three) |
|
144 | + { |
|
145 | + |
|
146 | + }//end oneSpaceAfterLongestVar() |
|
147 | 147 | |
148 | 148 | |
149 | 149 | }//end class |
@@ -159,19 +159,19 @@ discard block |
||
159 | 159 | */ |
160 | 160 | function functionOutsideClass(&$str, &$foo) |
161 | 161 | { |
162 | - return; |
|
162 | + return; |
|
163 | 163 | }//end functionOutsideClass() |
164 | 164 | |
165 | 165 | function missingCommentOutsideClass() |
166 | 166 | { |
167 | - return; |
|
167 | + return; |
|
168 | 168 | }//end missingCommentOutsideClass() |
169 | 169 | |
170 | 170 | |
171 | 171 | ?><?php |
172 | 172 | function tagBeforeComment() |
173 | 173 | { |
174 | - return; |
|
174 | + return; |
|
175 | 175 | }//end tagBeforeComment() |
176 | 176 | |
177 | 177 | |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | function myFunction() {} |
245 | 245 | |
246 | 246 | abstract class MyClass { |
247 | - /** |
|
248 | - * An abstract function. |
|
249 | - * |
|
250 | - * @return string[] |
|
251 | - */ |
|
252 | - abstract protected function myFunction(); |
|
247 | + /** |
|
248 | + * An abstract function. |
|
249 | + * |
|
250 | + * @return string[] |
|
251 | + */ |
|
252 | + abstract protected function myFunction(); |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
@@ -271,18 +271,18 @@ discard block |
||
271 | 271 | * |
272 | 272 | */ |
273 | 273 | function _() { |
274 | - return $foo; |
|
274 | + return $foo; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | class Baz { |
278 | - /** |
|
279 | - * The PHP5 constructor |
|
280 | - * |
|
281 | - * No return tag |
|
282 | - */ |
|
283 | - public function __construct() { |
|
284 | - |
|
285 | - } |
|
278 | + /** |
|
279 | + * The PHP5 constructor |
|
280 | + * |
|
281 | + * No return tag |
|
282 | + */ |
|
283 | + public function __construct() { |
|
284 | + |
|
285 | + } |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @return void |
296 | 296 | */ |
297 | 297 | function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { |
298 | - echo 'foo'; |
|
298 | + echo 'foo'; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * @return |
15 | 15 | * @throws |
16 | 16 | */ |
17 | - private function _functionCall($stackPtr, $depth=1, $index) |
|
17 | + private function _functionCall( $stackPtr, $depth = 1, $index ) |
|
18 | 18 | { |
19 | 19 | return $stackPtr; |
20 | 20 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * no return tag |
111 | 111 | * |
112 | 112 | */ |
113 | - public function noReturn($one) |
|
113 | + public function noReturn( $one ) |
|
114 | 114 | { |
115 | 115 | |
116 | 116 | }//end noReturn() |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * @param missing |
126 | 126 | * @param |
127 | 127 | */ |
128 | - public function missingDescription($threeSpaces) |
|
128 | + public function missingDescription( $threeSpaces ) |
|
129 | 129 | { |
130 | 130 | |
131 | 131 | }//end missingDescription() |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * |
141 | 141 | * @return void |
142 | 142 | */ |
143 | - public function oneSpaceAfterLongestVar($one, $two, $three) |
|
143 | + public function oneSpaceAfterLongestVar( $one, $two, $three ) |
|
144 | 144 | { |
145 | 145 | |
146 | 146 | }//end oneSpaceAfterLongestVar() |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | * |
158 | 158 | * @return void |
159 | 159 | */ |
160 | -function functionOutsideClass(&$str, &$foo) |
|
160 | +function functionOutsideClass( &$str, &$foo ) |
|
161 | 161 | { |
162 | 162 | return; |
163 | 163 | }//end functionOutsideClass() |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @return void |
196 | 196 | * @fine Unknown tag |
197 | 197 | */ |
198 | -function missingTwoParamComment($one, $two, $three) |
|
198 | +function missingTwoParamComment( $one, $two, $three ) |
|
199 | 199 | { |
200 | 200 | |
201 | 201 | }//end missingTwoParamComment() |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @access public |
218 | 218 | * @return bool |
219 | 219 | */ |
220 | -function myFunction($arg1) {} |
|
220 | +function myFunction( $arg1 ) {} |
|
221 | 221 | |
222 | 222 | |
223 | 223 | /** |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | echo $blah; |
233 | 233 | |
234 | -function myFunction($arg1) {} |
|
234 | +function myFunction( $arg1 ) {} |
|
235 | 235 | |
236 | 236 | /** |
237 | 237 | * Test function. |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * |
262 | 262 | * @return void |
263 | 263 | */ |
264 | -function foo(&$tokens, $tokenizer, $eolChar) |
|
264 | +function foo( &$tokens, $tokenizer, $eolChar ) |
|
265 | 265 | { |
266 | 266 | |
267 | 267 | }//end foo() |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * |
295 | 295 | * @return void |
296 | 296 | */ |
297 | -function completeStep($status, array $array = [Class1::class, 'test'], $note = '') { |
|
297 | +function completeStep( $status, array $array = [ Class1::class, 'test' ], $note = '' ) { |
|
298 | 298 | echo 'foo'; |
299 | 299 | } |
300 | 300 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * |
307 | 307 | * @return void |
308 | 308 | */ |
309 | -function myFunction(string $name1, string ...$name2) { |
|
309 | +function myFunction( string $name1, string ...$name2 ) { |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * |
319 | 319 | * @return void |
320 | 320 | */ |
321 | -function myFunction(string $name1, string ...$name2) { |
|
321 | +function myFunction( string $name1, string ...$name2 ) { |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * Return value |
334 | 334 | * |
335 | 335 | */ |
336 | -function foo($bar) { |
|
336 | +function foo( $bar ) { |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @return void |
349 | 349 | * @see register() |
350 | 350 | */ |
351 | -function process(File $phpcsFile, $stackPtr) |
|
351 | +function process( File $phpcsFile, $stackPtr ) |
|
352 | 352 | { |
353 | 353 | |
354 | 354 | }//end process() |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * @return void |
367 | 367 | * @see register() |
368 | 368 | */ |
369 | -function process(File $phpcsFile, $stackPtr) |
|
369 | +function process( File $phpcsFile, $stackPtr ) |
|
370 | 370 | { |
371 | 371 | |
372 | 372 | }//end process() |
@@ -1,6 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -class PHP_CodeSniffer_File |
|
3 | -{ |
|
2 | +class PHP_CodeSniffer_File { |
|
4 | 3 | |
5 | 4 | /** |
6 | 5 | * A simple function comment. |
@@ -14,8 +13,7 @@ discard block |
||
14 | 13 | * @return |
15 | 14 | * @throws |
16 | 15 | */ |
17 | - private function _functionCall($stackPtr, $depth=1, $index) |
|
18 | - { |
|
16 | + private function _functionCall($stackPtr, $depth=1, $index) { |
|
19 | 17 | return $stackPtr; |
20 | 18 | |
21 | 19 | }//end _functionCall() |
@@ -25,8 +23,7 @@ discard block |
||
25 | 23 | // |
26 | 24 | // |
27 | 25 | // |
28 | - public function invalidCommentStyle() |
|
29 | - { |
|
26 | + public function invalidCommentStyle() { |
|
30 | 27 | |
31 | 28 | }//end invalidCommentStyle() |
32 | 29 | |
@@ -42,8 +39,7 @@ discard block |
||
42 | 39 | * |
43 | 40 | * @return void |
44 | 41 | */ |
45 | - public function extraDescriptionNewlines() |
|
46 | - { |
|
42 | + public function extraDescriptionNewlines() { |
|
47 | 43 | |
48 | 44 | }//end extraDescriptionNewlines() |
49 | 45 | |
@@ -52,8 +48,7 @@ discard block |
||
52 | 48 | * A simple function comment |
53 | 49 | * @return void |
54 | 50 | */ |
55 | - public function missingNewlinesBeforeTags() |
|
56 | - { |
|
51 | + public function missingNewlinesBeforeTags() { |
|
57 | 52 | |
58 | 53 | }//end missingNewlinesBeforeTags() |
59 | 54 | |
@@ -64,8 +59,7 @@ discard block |
||
64 | 59 | * @access public |
65 | 60 | * @return void |
66 | 61 | */ |
67 | - public function accessTag() |
|
68 | - { |
|
62 | + public function accessTag() { |
|
69 | 63 | |
70 | 64 | }//end accessTag() |
71 | 65 | |
@@ -74,8 +68,7 @@ discard block |
||
74 | 68 | * |
75 | 69 | * No return tag |
76 | 70 | */ |
77 | - function PHP_CodeSniffer_File() |
|
78 | - { |
|
71 | + function PHP_CodeSniffer_File() { |
|
79 | 72 | return; |
80 | 73 | } |
81 | 74 | |
@@ -85,8 +78,7 @@ discard block |
||
85 | 78 | * |
86 | 79 | * No return tag too |
87 | 80 | */ |
88 | - function _PHP_CodeSniffer_File() |
|
89 | - { |
|
81 | + function _PHP_CodeSniffer_File() { |
|
90 | 82 | return; |
91 | 83 | } |
92 | 84 | |
@@ -94,14 +86,12 @@ discard block |
||
94 | 86 | /** |
95 | 87 | * Destructor PHP5 |
96 | 88 | */ |
97 | - function __destruct() |
|
98 | - { |
|
89 | + function __destruct() { |
|
99 | 90 | return; |
100 | 91 | } |
101 | 92 | |
102 | 93 | |
103 | - function missingComment() |
|
104 | - { |
|
94 | + function missingComment() { |
|
105 | 95 | return; |
106 | 96 | } |
107 | 97 | |
@@ -110,8 +100,7 @@ discard block |
||
110 | 100 | * no return tag |
111 | 101 | * |
112 | 102 | */ |
113 | - public function noReturn($one) |
|
114 | - { |
|
103 | + public function noReturn($one) { |
|
115 | 104 | |
116 | 105 | }//end noReturn() |
117 | 106 | |
@@ -125,8 +114,7 @@ discard block |
||
125 | 114 | * @param missing |
126 | 115 | * @param |
127 | 116 | */ |
128 | - public function missingDescription($threeSpaces) |
|
129 | - { |
|
117 | + public function missingDescription($threeSpaces) { |
|
130 | 118 | |
131 | 119 | }//end missingDescription() |
132 | 120 | |
@@ -140,8 +128,7 @@ discard block |
||
140 | 128 | * |
141 | 129 | * @return void |
142 | 130 | */ |
143 | - public function oneSpaceAfterLongestVar($one, $two, $three) |
|
144 | - { |
|
131 | + public function oneSpaceAfterLongestVar($one, $two, $three) { |
|
145 | 132 | |
146 | 133 | }//end oneSpaceAfterLongestVar() |
147 | 134 | |
@@ -157,20 +144,17 @@ discard block |
||
157 | 144 | * |
158 | 145 | * @return void |
159 | 146 | */ |
160 | -function functionOutsideClass(&$str, &$foo) |
|
161 | -{ |
|
147 | +function functionOutsideClass(&$str, &$foo) { |
|
162 | 148 | return; |
163 | 149 | }//end functionOutsideClass() |
164 | 150 | |
165 | -function missingCommentOutsideClass() |
|
166 | -{ |
|
151 | +function missingCommentOutsideClass() { |
|
167 | 152 | return; |
168 | 153 | }//end missingCommentOutsideClass() |
169 | 154 | |
170 | 155 | |
171 | 156 | ?><?php |
172 | -function tagBeforeComment() |
|
173 | -{ |
|
157 | +function tagBeforeComment() { |
|
174 | 158 | return; |
175 | 159 | }//end tagBeforeComment() |
176 | 160 | |
@@ -181,8 +165,7 @@ discard block |
||
181 | 165 | * |
182 | 166 | * |
183 | 167 | */ |
184 | -function noReturnOutsideClass() |
|
185 | -{ |
|
168 | +function noReturnOutsideClass() { |
|
186 | 169 | |
187 | 170 | }//end noReturnOutsideClass() |
188 | 171 | |
@@ -195,8 +178,7 @@ discard block |
||
195 | 178 | * @return void |
196 | 179 | * @fine Unknown tag |
197 | 180 | */ |
198 | -function missingTwoParamComment($one, $two, $three) |
|
199 | -{ |
|
181 | +function missingTwoParamComment($one, $two, $three) { |
|
200 | 182 | |
201 | 183 | }//end missingTwoParamComment() |
202 | 184 | |
@@ -204,8 +186,7 @@ discard block |
||
204 | 186 | /** |
205 | 187 | * |
206 | 188 | */ |
207 | -function emptyFunctionDocComment() |
|
208 | -{ |
|
189 | +function emptyFunctionDocComment() { |
|
209 | 190 | }//end emptyFunctionDocComment() |
210 | 191 | |
211 | 192 | |
@@ -261,8 +242,7 @@ discard block |
||
261 | 242 | * |
262 | 243 | * @return void |
263 | 244 | */ |
264 | -function foo(&$tokens, $tokenizer, $eolChar) |
|
265 | -{ |
|
245 | +function foo(&$tokens, $tokenizer, $eolChar) { |
|
266 | 246 | |
267 | 247 | }//end foo() |
268 | 248 | |
@@ -348,8 +328,7 @@ discard block |
||
348 | 328 | * @return void |
349 | 329 | * @see register() |
350 | 330 | */ |
351 | -function process(File $phpcsFile, $stackPtr) |
|
352 | -{ |
|
331 | +function process(File $phpcsFile, $stackPtr) { |
|
353 | 332 | |
354 | 333 | }//end process() |
355 | 334 | |
@@ -366,7 +345,6 @@ discard block |
||
366 | 345 | * @return void |
367 | 346 | * @see register() |
368 | 347 | */ |
369 | -function process(File $phpcsFile, $stackPtr) |
|
370 | -{ |
|
348 | +function process(File $phpcsFile, $stackPtr) { |
|
371 | 349 | |
372 | 350 | }//end process() |