phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: class-string generic with union return resolves from variadic class-string args
// feature: completion
// Adapted from phpactor generics/class-string-generic-union.test
// expect: doA(
// expect: doB(
---
<?php

class A {
    public function doA(): void {}
}
class B {
    public function doB(): void {}
}

class Foo
{
    /**
     * @template T
     * @param class-string<T> $foo
     * @return T
     */
    public function bar(string ...$foo)
    {
    }
}

$f = new Foo();
$res = $f->bar(A::class, B::class);
$res-><>