diff --git a/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc similarity index 94% rename from src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc rename to src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc index 70ecd98a12..a4b0a07f9d 100644 --- a/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc +++ b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc @@ -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 )$spacesInsideParenthesis; +$var = ( int )$tabsInsideParenthesis; diff --git a/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc.fixed b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed similarity index 94% rename from src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc.fixed rename to src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed index f9b2a592aa..fd2b920dcb 100644 --- a/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.1.inc.fixed @@ -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 ) $spacesInsideParenthesis; +$var = ( int ) $tabsInsideParenthesis; diff --git a/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.2.inc b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.2.inc new file mode 100644 index 0000000000..7e947a2645 --- /dev/null +++ b/src/Standards/Generic/Tests/Formatting/SpaceAfterCastUnitTest.2.inc @@ -0,0 +1,3 @@ + */ - public function getErrorList() + public function getErrorList($testFile='') { - 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, - ]; + 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, + 97 => 1, + 99 => 1, + 100 => 1, + ]; + + default: + return []; + }//end switch }//end getErrorList()