phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// 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-><>
}