Skip to content

Commit 3449da1

Browse files
committed
Fixes
1 parent 81ade36 commit 3449da1

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

SlevomatCodingStandard/Sniffs/Classes/PropertyDeclarationSniff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
use const T_READONLY;
3434
use const T_SEMICOLON;
3535
use const T_STATIC;
36-
use const T_TYPE_INTERSECTION;
3736
use const T_TYPE_UNION;
3837
use const T_VAR;
3938
use const T_VARIABLE;
@@ -105,7 +104,7 @@ public function process(File $phpcsFile, $modifierPointer): void
105104
return;
106105
}
107106

108-
if (in_array($tokens[$nextPointer]['code'], [T_OPEN_CURLY_BRACKET, T_SEMICOLON, T_TYPE_UNION, T_TYPE_INTERSECTION], true)) {
107+
if (in_array($tokens[$nextPointer]['code'], [T_OPEN_CURLY_BRACKET, T_SEMICOLON, T_TYPE_UNION], true)) {
109108
// Ignore "static" as return type hint of method
110109
return;
111110
}

tests/Sniffs/Classes/data/propertyDeclarationNoErrors.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php // lint >= 8.1
1+
<?php // lint >= 8.4
22

33
class Whatever
44
{
@@ -86,15 +86,7 @@ public function begin(): false|static|null
8686
protected array $field = [];
8787
}
8888

89-
class Test6
90-
{
91-
public function begin(): static&null
92-
{}
93-
94-
protected array $field = [];
95-
}
96-
97-
class Tes7
89+
class Tes6
9890
{
9991
public static function begin(): static
10092
{

0 commit comments

Comments
 (0)