Skip to content

Commit 03a4c0c

Browse files
Annotation test
1 parent 9011b81 commit 03a4c0c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/PHPStan/Rules/Pure/PureMethodRuleTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ public function testBug12382(): void
224224
'Method Bug12382\FinalHelloWorld2::dummy() is marked as impure but does not have any side effects.',
225225
33,
226226
],
227+
[
228+
'Method Bug12382\FinalHelloWorld3::dummy() is marked as impure but does not have any side effects.',
229+
42,
230+
],
231+
[
232+
'Method Bug12382\FinalHelloWorld4::dummy() is marked as impure but does not have any side effects.',
233+
53,
234+
],
227235
]);
228236
}
229237

tests/PHPStan/Rules/Pure/data/bug-12382.php

+20
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,23 @@ final public function dummy() : self{
3434
return $this;
3535
}
3636
}
37+
38+
/** @final */
39+
class FinalHelloWorld3
40+
{
41+
/** @phpstan-impure */
42+
public function dummy() : self{
43+
return $this;
44+
}
45+
}
46+
47+
class FinalHelloWorld4
48+
{
49+
/**
50+
* @final
51+
* @phpstan-impure
52+
*/
53+
public function dummy() : self{
54+
return $this;
55+
}
56+
}

0 commit comments

Comments
 (0)