phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: if instanceof narrows to intersection when existing type is an unrelated interface
// feature: completion
// expect: id
// expect: shouldReceive(
---
<?php

interface MockInterface {
    public function shouldReceive(string $name): self;
}

class MolliePayment {
    /** @var string */
    public string $id;
    public function canBeRefunded(): bool { return true; }
}

class TestCase {
    /** @return MockInterface */
    public function mock(string $class): MockInterface {}

    public function test(): void {
        $molliePayment = $this->mock(MolliePayment::class);
        if ($molliePayment instanceof MolliePayment) {
            $molliePayment-><>
        }
    }
}