We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bec0a6f commit f409b6cCopy full SHA for f409b6c
1 file changed
tests/PHPStan/Analyser/nsrt/bug-4890-php8.php
@@ -0,0 +1,23 @@
1
+<?php // lint >= 8.0
2
+
3
+namespace Bug4890Php8;
4
5
+use function PHPStan\Testing\assertType;
6
7
+enum MyEnum
8
+{
9
+ case CASE1;
10
+ case CASE2;
11
12
+ public function someMethod(): bool { return true; }
13
+}
14
15
+class HelloWorld
16
17
+ public function withEnumCase(\UnitEnum $entity): void
18
+ {
19
+ assertType('class-string<UnitEnum>', get_class($entity));
20
+ assert(method_exists($entity, 'someMethod'));
21
+ assertType('class-string<UnitEnum&hasMethod(someMethod)>', get_class($entity));
22
+ }
23
0 commit comments