phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: method-level @template resolves return type from argument
// feature: completion
// Adapted from phpactor generics/method_generic.test
// expect: strMethod(
---
<?php
class StringResult {
    public function strMethod(): void {}
}
class Foo
{
    /**
     * @template T
     * @param T $foo
     * @return T
     */
    public function bar($foo)
    {
        return $foo;
    }
}
$f = new Foo();
$res = $f->bar(new StringResult());
$res-><>