Skip to content

Commit be46b97

Browse files
committed
Various sniffs: add tests with PHP 8.5 (void) cast
1 parent 6a55c7c commit be46b97

15 files changed

+40
-5
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ $var = (boolean)/* comment */ $var2;
9898

9999
$var = ( int )$spacesInsideParenthesis;
100100
$var = ( int )$tabsInsideParenthesis;
101+
102+
$var = (void) callMe();
103+
$var = (void)callMe();
104+
$var = (void) callMe();

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ $var = (boolean)/* comment */ $var2;
9595

9696
$var = ( int ) $spacesInsideParenthesis;
9797
$var = ( int ) $tabsInsideParenthesis;
98+
99+
$var = (void) callMe();
100+
$var = (void) callMe();
101+
$var = (void) callMe();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public function getErrorList($testFile = '')
7777
97 => 1,
7878
99 => 1,
7979
100 => 1,
80+
103 => 1,
81+
104 => 1,
8082
];
8183

8284
default:

src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ $var = array(
6363
);
6464

6565
(bool) $a ? echo $b : echo $c;
66+
67+
$var = (void) callMe();
68+
$var =(void) callMe();
69+
$var = (void) callMe();

src/Standards/Generic/Tests/Formatting/SpaceBeforeCastUnitTest.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,7 @@ $var = array(
6363
);
6464

6565
(bool) $a ? echo $b : echo $c;
66+
67+
$var = (void) callMe();
68+
$var = (void) callMe();
69+
$var = (void) callMe();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public function getErrorList()
6161
53 => 1,
6262
55 => 1,
6363
56 => 1,
64+
68 => 1,
65+
69 => 1,
6466
];
6567
}
6668

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.1.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,5 @@ class DNFTypes {
142142
interface PHP84HookedProperty {
143143
public String $readable { get; }
144144
}
145+
146+
$php85 = (VOID) callMe();

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.1.inc.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,5 @@ class DNFTypes {
142142
interface PHP84HookedProperty {
143143
public string $readable { get; }
144144
}
145+
146+
$php85 = (void) callMe();

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function getErrorList($testFile = '')
9999
136 => 1,
100100
139 => 2,
101101
143 => 1,
102+
146 => 1,
102103
];
103104

104105
default:

src/Standards/Squiz/Tests/Formatting/OperatorBracketUnitTest.1.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,5 @@ $cntPages = ceil(count($items) / parent::ON_PAGE);
205205
$nsRelative = namespace\doSomething($items + 10);
206206
$partiallyQualified = Partially\qualified($items + 10);
207207
$fullyQualified = \Fully\qualified($items + 10);
208+
209+
$php85voidcast = (void) CallMeOnce() + (void) CallMeTwice();

0 commit comments

Comments
 (0)