Skip to content

Commit bd384b8

Browse files
Narrow type
1 parent 6fd2727 commit bd384b8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/static-analysis/TestUsingCallbacks.php

+10-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@ public function testWillSayHelloAndCheckCallbackInput(): void
2727
$mock
2828
->expects(self::once())
2929
->method('hey')
30-
->with(self::callback(static function (string $input): bool {
31-
self::assertStringContainsString('Joe', $input);
32-
33-
return true;
34-
}))
30+
->with(
31+
self::callback(
32+
/** @psalm-param non-empty-string $input */
33+
static function (string $input): bool {
34+
self::assertStringContainsString('Joe', $input);
35+
36+
return true;
37+
}
38+
)
39+
)
3540
->willReturn('Hey Joe!');
3641

3742
self::assertSame('Hey Joe!', $mock->hey('Joe'));

0 commit comments

Comments
 (0)