phpantom_lsp 0.7.0

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

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

class MolliePayment {
    public function canBeRefunded(): bool { return true; }
}

class TestCase {
    public function getPayment(): MolliePayment {}

    public function test(): void {
        $payment = $this->getPayment();
        assert($payment instanceof MockInterface);
        $payment-><>
    }
}