phpantom_lsp 0.7.0

Fast PHP language server with deep type intelligence. Generics, Laravel, PHPStan annotations. Ready in an instant.
Documentation
// test: IteratorAggregate with @implements generic resolves item type in foreach
// feature: completion
// Adapted from phpactor foreach/generic_iterator_aggregate.test

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

class TypeAssertion {
    public function assertMethod(): void {}
}

/**
 * @implements \IteratorAggregate<array-key, TypeAssertion>
 */
final class TypeAssertions implements \IteratorAggregate {}

function test(TypeAssertions $assertions): void
{
    foreach ($assertions as $typeAssertion) {
        $typeAssertion-><>
    }
}