File tree Expand file tree Collapse file tree 4 files changed +65
-41
lines changed
src/Standards/Generic/Tests/Formatting Expand file tree Collapse file tree 4 files changed +65
-41
lines changed Original file line number Diff line number Diff line change @@ -93,3 +93,8 @@ $var = (int)
93
93
$ var1 + (bool ) $ var2 ;
94
94
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
95
95
// phpcs:set Generic.Formatting.SpaceAfterCast spacing 1
96
+
97
+ $ var = (boolean )/* comment */ $ var2 ;
98
+
99
+ $ var = ( int )$ spacesInsideParenthesis ;
100
+ $ var = ( int )$ tabsInsideParenthesis ;
Original file line number Diff line number Diff line change @@ -90,3 +90,8 @@ $var = (int)
90
90
$var1 + (bool)$var2;
91
91
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
92
92
// phpcs:set Generic.Formatting.SpaceAfterCast spacing 1
93
+
94
+ $var = (boolean)/* comment */ $var2;
95
+
96
+ $var = ( int ) $spacesInsideParenthesis;
97
+ $var = ( int ) $tabsInsideParenthesis;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ $ var = (int )
Original file line number Diff line number Diff line change @@ -26,50 +26,61 @@ final class SpaceAfterCastUnitTest extends AbstractSniffUnitTest
26
26
* The key of the array should represent the line number and the value
27
27
* should represent the number of errors that should occur on that line.
28
28
*
29
+ * @param string $testFile The name of the test file to run.
30
+ *
29
31
* @return array<int, int>
30
32
*/
31
- public function getErrorList ()
33
+ public function getErrorList ($ testFile = '' )
32
34
{
33
- return [
34
- 4 => 1 ,
35
- 5 => 1 ,
36
- 8 => 1 ,
37
- 9 => 1 ,
38
- 12 => 1 ,
39
- 13 => 1 ,
40
- 16 => 1 ,
41
- 17 => 1 ,
42
- 20 => 1 ,
43
- 21 => 1 ,
44
- 24 => 1 ,
45
- 25 => 1 ,
46
- 28 => 1 ,
47
- 29 => 1 ,
48
- 32 => 1 ,
49
- 33 => 1 ,
50
- 36 => 1 ,
51
- 37 => 1 ,
52
- 40 => 1 ,
53
- 41 => 1 ,
54
- 44 => 1 ,
55
- 45 => 1 ,
56
- 51 => 1 ,
57
- 53 => 1 ,
58
- 55 => 1 ,
59
- 58 => 1 ,
60
- 64 => 1 ,
61
- 72 => 1 ,
62
- 73 => 1 ,
63
- 75 => 1 ,
64
- 76 => 1 ,
65
- 78 => 1 ,
66
- 82 => 1 ,
67
- 84 => 1 ,
68
- 85 => 1 ,
69
- 86 => 1 ,
70
- 88 => 1 ,
71
- 93 => 1 ,
72
- ];
35
+ switch ($ testFile ) {
36
+ case 'SpaceAfterCastUnitTest.1.inc ' :
37
+ return [
38
+ 4 => 1 ,
39
+ 5 => 1 ,
40
+ 8 => 1 ,
41
+ 9 => 1 ,
42
+ 12 => 1 ,
43
+ 13 => 1 ,
44
+ 16 => 1 ,
45
+ 17 => 1 ,
46
+ 20 => 1 ,
47
+ 21 => 1 ,
48
+ 24 => 1 ,
49
+ 25 => 1 ,
50
+ 28 => 1 ,
51
+ 29 => 1 ,
52
+ 32 => 1 ,
53
+ 33 => 1 ,
54
+ 36 => 1 ,
55
+ 37 => 1 ,
56
+ 40 => 1 ,
57
+ 41 => 1 ,
58
+ 44 => 1 ,
59
+ 45 => 1 ,
60
+ 51 => 1 ,
61
+ 53 => 1 ,
62
+ 55 => 1 ,
63
+ 58 => 1 ,
64
+ 64 => 1 ,
65
+ 72 => 1 ,
66
+ 73 => 1 ,
67
+ 75 => 1 ,
68
+ 76 => 1 ,
69
+ 78 => 1 ,
70
+ 82 => 1 ,
71
+ 84 => 1 ,
72
+ 85 => 1 ,
73
+ 86 => 1 ,
74
+ 88 => 1 ,
75
+ 93 => 1 ,
76
+ 97 => 1 ,
77
+ 99 => 1 ,
78
+ 100 => 1 ,
79
+ ];
80
+
81
+ default :
82
+ return [];
83
+ }//end switch
73
84
74
85
}//end getErrorList()
75
86
You can’t perform that action at this time.
0 commit comments