Skip to content

Commit 7981602

Browse files
committed
fix php < 8.2
1 parent aeba6b0 commit 7981602

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

tests/PHPStan/Rules/TooWideTypehints/TooWideFunctionReturnTypehintRuleTest.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testBug13384cPhp82(): void
8080
$this->analyse([__DIR__ . '/data/bug-13384c.php'], [
8181
[
8282
'Function Bug13384c\callsReturnsTrue() never returns false so the return type can be changed to true.',
83-
112,
83+
115,
8484
],
8585
]);
8686
}
@@ -90,16 +90,7 @@ public function testBug13384cPrePhp82(): void
9090
{
9191
$this->reportTooWideBool = true;
9292
$this->reportNestedTooWideType = true;
93-
$this->analyse([__DIR__ . '/data/bug-13384c.php'], [
94-
[
95-
'Function Bug13384c\doFooPhpdoc() never returns false so the return type can be changed to true.',
96-
93,
97-
],
98-
[
99-
'Function Bug13384c\doFooPhpdoc2() never returns true so the return type can be changed to false.',
100-
100,
101-
],
102-
]);
93+
$this->analyse([__DIR__ . '/data/bug-13384c.php'], []);
10394
}
10495

10596
public function testBug13384cOff(): void

tests/PHPStan/Rules/TooWideTypehints/data/bug-13384c.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ function doFooMixed() {
105105
return true;
106106
}
107107

108-
function returnsTrue(): true {
108+
/**
109+
* @return true
110+
*/
111+
function returnsTrue(): bool {
109112
return true;
110113
}
111114

0 commit comments

Comments
 (0)