Skip to content

Commit 16247b9

Browse files
authored
Merge pull request #356 from PHPCSStandards/feature/universal-staticinfinalclass-add-extra-test
Universal/StaticInFinalClass: add test with static in DNF return type
2 parents 68e3551 + 2e42901 commit 16247b9

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Universal/Tests/CodeAnalysis/StaticInFinalClassUnitTest.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ final class ArrowFunctionsAreOpen {
172172
}
173173
}
174174

175+
final class DNFReturnType {
176+
public function hasDNF() : (A&static)|null {}
177+
}
178+
175179

176180
// Live coding. This has to be the last test in the file.
177181
class LiveCoding extends Foo {

Universal/Tests/CodeAnalysis/StaticInFinalClassUnitTest.inc.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ final class ArrowFunctionsAreOpen {
172172
}
173173
}
174174

175+
final class DNFReturnType {
176+
public function hasDNF() : (A&self)|null {}
177+
}
178+
175179

176180
// Live coding. This has to be the last test in the file.
177181
class LiveCoding extends Foo {

Universal/Tests/CodeAnalysis/StaticInFinalClassUnitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function getErrorList()
5151
163 => 1,
5252
165 => 1,
5353
171 => 2,
54+
176 => 1,
5455
];
5556
}
5657

0 commit comments

Comments
 (0)