phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: generic narrowing with @phpstan-assert and class-string<T> resolves type
// feature: completion
// Adapted from phpactor narrowing/narrow-generic.test

// expect: fooMethod(
---
<?php

class Foobar {
    public function fooMethod(): void {}
}

final class Assert
{
    /**
     * @template ExpectedType of object
     * @param class-string<ExpectedType> $expected
     * @phpstan-assert ExpectedType $actual
     */
    public static function assertFoobar(string $expected, object $actual): void
    {
    }
}

function foo(object $obj): void {
    Assert::assertFoobar(Foobar::class, $obj);
    $obj-><>
}