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 return combined with class-level @extends resolves both
// feature: completion
// Adapted from phpactor generics patterns combining method and class templates
// expect: itemMethod(
---
<?php

class Item {
    public function itemMethod(): void {}
}

/**
 * @template TItem
 */
class Repository
{
    /**
     * @return TItem
     */
    public function find(int $id) {}

    /**
     * @template T
     * @param T $entity
     * @return T
     */
    public function save($entity) {}
}

/**
 * @extends Repository<Item>
 */
class ItemRepository extends Repository {}

$repo = new ItemRepository();
$result = $repo->find(1);
$result-><>