phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: constructor param combined with extends infers template type
// feature: completion
// Adapted from phpactor generics/constructor-param-and-extend.test
// expect: bMethod(
---
<?php

class B {
    public function bMethod(): void {}
}

/**
 * @template T
 */
class Bar {
    /**
     * @return T
     */
    public function b() {}
}

/**
 * @template T
 * @extends Bar<T>
 */
class Foo extends Bar {
    /** @param T $a */
    public function __construct($a) {}

    /** @return T */
    public function a() {}
}

$f = new Foo(new B());
$f->b()-><>