Repository navigation
fix(php): resolve method calls through $this-> property on its declared type - #139
Merged
sunerpy merged 1 commit intoJul 14, 2026
Merged
Conversation
…ed type Ports upstream colby #1220. A `$this->dep->method()` call — the dominant shape in constructor-injection codebases (Symfony, Laravel) — now resolves to the method on the property `$dep`'s declared type, so callers and impact analysis see the production call sites instead of reporting a DI-heavy method as uncalled or test-only. Resolution consults PROPERTY-shaped declarations only: a typed property (`private Foo $dep;`), a promoted constructor parameter (`public function __construct(private Foo $dep)`), a classic constructor assignment (`$this->dep = $dep;` with a typed parameter, multi-line signatures included), and typed setter injection. Interface-typed properties resolve to the interface method and inherited methods resolve through the type hierarchy via the existing conformance pass. Because only property-shaped declarations are consulted, a same-named local variable or parameter elsewhere can never mistype the property, and a property whose type cannot be recovered statically stays unlinked rather than guessed — the PHP-property branch returns unconditionally instead of falling through to the fuzzy name strategies. Resolve-side only: the extractor already emits the `this->dep.method` reference shape, so no extraction change and no new node kind. Golden .schema and all fixtures are unchanged (the corpus has no PHP; no regen).
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #139 +/- ##
==========================================
- Coverage 95.63% 95.63% -0.01%
==========================================
Files 115 115
Lines 56095 56803 +708
==========================================
+ Hits 53649 54325 +676
- Misses 2446 2478 +32
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
sunerpy
deleted the
feat/upstream-1.4.1-release-c-php-property-resolution
branch
July 14, 2026 08:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upstream-sync Release C — ports colby #1220 (
70b1be6).$this->dep->method()(the dominant call shape in constructor-injection codebases — Symfony, Laravel) now resolves to the method on property$dep's declared type, so callers/impact see production call sites instead of reporting a DI-heavy method as uncalled or test-only.private Foo $dep;), promoted ctor param, classic ctor assignment ($this->dep = $dep;with a typed param, multi-line signatures included), typed setter injection.$this->prop->methoddeferral wired in).this->dep.methodreference shape, so no extraction change, no new node kind.Verification
local_var_php_new/typed_param_phpregressions still green.make cigreen (fmt + clippy + test + guardrail + equivalence)..schema+ fixtures byte-identical, NO regen (corpus has no PHP; the resolve-side branch only fires onthis->\w+.\w+PHP refs).Release C of the chosen 1.2.0→1.4.1 upstream PORT subset.