phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: or instanceof narrows to union of both types
// feature: completion
// Adapted from phpactor if-statement/union_or.test
// expect: fooMethod(
// expect: barMethod(
---
<?php

class Foobar {
    public function fooMethod(): void {}
}

class Barfoo {
    public function barMethod(): void {}
}

class Other {
    public function otherMethod(): void {}
}

function test(Foobar|Barfoo|Other $foobar): void {
    if ($foobar instanceof Foobar || $foobar instanceof Barfoo) {
        $foobar-><>
    }
}