// test: @phpstan-assert-if-false narrows type in else branch
// feature: completion
// Adapted from phpactor narrowing patterns with @phpstan-assert-if-false
// expect: send(
---
<?php
class Email {
public function send(): void {}
}
class Guard {
/**
* @phpstan-assert-if-false Email $value
*/
public static function isInvalid(mixed $value): bool {}
}
function test(mixed $input): void {
if (Guard::isInvalid($input)) {
return;
}
$input-><>
}