Skip to content

Commit d8b8ba1

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/SpaceAfterCast: improve code coverage
1 parent 7e282a0 commit d8b8ba1

File tree

4 files changed

+54
-38
lines changed

4 files changed

+54
-38
lines changed

src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc

+5
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ $var = (int)
9393
$var1 + (bool) $var2;
9494
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
9595
// phpcs:set Generic.Formatting.SpaceAfterCast spacing 1
96+
97+
$var = (boolean)/* comment */ $var2;
98+
99+
$var = ( int )$spacesInsideParenthesis;
100+
$var = ( int )$tabsInsideParenthesis;

src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed

+5
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,8 @@ $var = (int)
9090
$var1 + (bool)$var2;
9191
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
9292
// 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 numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
$var = (int)

src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php

+41-38
Original file line numberDiff line numberDiff line change
@@ -35,44 +35,47 @@ public function getErrorList($testFile='')
3535
switch ($testFile) {
3636
case 'SpaceAfterCastUnitTest.1.inc':
3737
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,
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,
7679
];
7780

7881
default:

0 commit comments

Comments
 (0)