Skip to content

Commit

Permalink
Generic/SpaceAfterCast: improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed May 10, 2024
1 parent d1664db commit beb6eed
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,8 @@ $var = (int)
$var1 + (bool) $var2;
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
// phpcs:set Generic.Formatting.SpaceAfterCast spacing 1

$var = (boolean)/* comment */ $var2;

$var = ( int )$var2;
$var = ( int )$var2;
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ $var = (int)
$var1 + (bool)$var2;
// phpcs:set Generic.Formatting.SpaceAfterCast ignoreNewlines false
// phpcs:set Generic.Formatting.SpaceAfterCast spacing 1

$var = (boolean)/* comment */ $var2;

$var = ( int ) $var2;
$var = ( int ) $var2;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

$var = (int)
79 changes: 41 additions & 38 deletions src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,44 +35,47 @@ public function getErrorList($testFile='')
switch ($testFile) {
case 'SpaceAfterCastUnitTest.1.inc':
return [
4 => 1,
5 => 1,
8 => 1,
9 => 1,
12 => 1,
13 => 1,
16 => 1,
17 => 1,
20 => 1,
21 => 1,
24 => 1,
25 => 1,
28 => 1,
29 => 1,
32 => 1,
33 => 1,
36 => 1,
37 => 1,
40 => 1,
41 => 1,
44 => 1,
45 => 1,
51 => 1,
53 => 1,
55 => 1,
58 => 1,
64 => 1,
72 => 1,
73 => 1,
75 => 1,
76 => 1,
78 => 1,
82 => 1,
84 => 1,
85 => 1,
86 => 1,
88 => 1,
93 => 1,
4 => 1,
5 => 1,
8 => 1,
9 => 1,
12 => 1,
13 => 1,
16 => 1,
17 => 1,
20 => 1,
21 => 1,
24 => 1,
25 => 1,
28 => 1,
29 => 1,
32 => 1,
33 => 1,
36 => 1,
37 => 1,
40 => 1,
41 => 1,
44 => 1,
45 => 1,
51 => 1,
53 => 1,
55 => 1,
58 => 1,
64 => 1,
72 => 1,
73 => 1,
75 => 1,
76 => 1,
78 => 1,
82 => 1,
84 => 1,
85 => 1,
86 => 1,
88 => 1,
93 => 1,
97 => 1,
99 => 1,
100 => 1,
];

default:
Expand Down

0 comments on commit beb6eed

Please sign in to comment.