Skip to content

Commit 957c096

Browse files
Fix hallucination
1 parent 2abc27a commit 957c096

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

tests/PHPStan/Analyser/nsrt/bug-10422.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Foo
99
{
1010

11-
public function other(): bool
11+
public function something(): bool
1212
{
1313
return true;
1414
}
@@ -29,11 +29,14 @@ function testSimple(): void
2929
$test = createOrNotObject();
3030

3131
$error = '';
32+
3233
if (!$test) {
33-
$error = 'yes';
34+
$error = 'missing test';
35+
} else if ($test->something()) {
36+
$error = 'another';
3437
}
3538
if ($error) {
36-
return;
39+
die('Done');
3740
}
3841
assertType(Foo::class, $test);
3942
}

tests/PHPStan/Analyser/nsrt/bug-11218.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ class HelloWorld
99

1010
public function test(): void
1111
{
12+
$level = 'foo';
1213
for ($i = 1; $i <= 3; $i++) {
13-
if ($i === 1) {
14-
$test = 'value';
14+
if ($i === 0) {
15+
$test[$level] = 'this is a';
16+
} else {
17+
assertType("array{test: literal-string&lowercase-string&non-falsy-string}", $test);
18+
$test[$level] .= ' test';
1519
}
1620
}
17-
18-
assertType("'value'", $test);
1921
}
2022

2123
}

tests/PHPStan/Analyser/nsrt/bug-13591.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class HelloWorld
1010

1111
public function test(string $action, ?int $hotelId): void
1212
{
13-
if ($action === 'get_rooms' && $hotelId === null) {
13+
if (($action === 'get_rooms' || $action === 'get_rooms_2') && $hotelId === null) {
1414
throw new InvalidArgumentException('Hotel ID is required');
1515
}
1616

0 commit comments

Comments
 (0)