Files
codebase-memory-mcp/tests
Martin Vogel d8646dae91 feat(php-lsp): trait self substitution + 2-pass class processing
When a trait method declares `: self` as its return type, flattening
that method into a using class now substitutes the trait's QN with the
using class's QN in the return type. This fixes fluent chains like:

    trait T { public function tap(): self { return $this; } }
    class C { use T; public function ok(): int { return 1; } }
    $c->tap()->ok();   // resolves through to C.ok now

Implementation:
  - flatten_trait_into_class scans the source method's signature for
    NAMED(trait_qn) in the return type and rewrites it to
    NAMED(using_class_qn) when registering the flattened method.
  - php_lsp_collect_class_fields now does TWO passes — pass 0 for
    trait/interface declarators (so their declared-return-types get
    re-parsed before any consumer), pass 1 for class/enum (which may
    `use Trait;` and need the trait's signatures already up-to-date).

Total tests: 3013 / 0 failed (200 php_lsp).
2026-05-09 14:50:06 +02:00
..
2026-04-15 23:56:03 +02:00