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 variadic parameter resolves union return type
// feature: completion
// Adapted from phpactor generics/method_generic_class-string-union_return.test
// expect: aMethod(
// expect: bMethod(
---
<?php

class A {
    public function aMethod(): void {}
}
class B {
    public function bMethod(): 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-><>