Skip to content

Commit c0e78e4

Browse files
committed
Test
1 parent 5c0cccc commit c0e78e4

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/PHPStan/Rules/PhpDoc/IncompatibleClassConstantPhpDocTypeRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function testRule(): void
3636
'PHPDoc tag @var for constant IncompatibleClassConstantPhpDoc\Foo::DOLOR contains generic type IncompatibleClassConstantPhpDoc\Foo<int> but class IncompatibleClassConstantPhpDoc\Foo is not generic.',
3737
26,
3838
],
39+
[
40+
'PHPDoc tag @var for constant IncompatibleClassConstantPhpDoc\Bar::BAZ with type string is incompatible with value 2.',
41+
35,
42+
],
3943
]);
4044
}
4145

tests/PHPStan/Rules/PhpDoc/data/incompatible-class-constant-phpdoc.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,27 @@ class Foo
2626
const DOLOR = 1;
2727

2828
}
29+
30+
class Bar extends Foo
31+
{
32+
33+
const BAR = 2;
34+
35+
const BAZ = 2;
36+
37+
}
38+
39+
class Baz
40+
{
41+
42+
/** @var string */
43+
private const BAZ = 'foo';
44+
45+
}
46+
47+
class Lorem extends Baz
48+
{
49+
50+
private const BAZ = 1;
51+
52+
}

0 commit comments

Comments
 (0)