Skip to content

fix(laravel): infer morph constraint candidate builders - #451

Open
shuvroroy wants to merge 5 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l58-morph-callback-models
Open

shuvroroy wants to merge 5 commits into
PHPantom-dev:mainfrom
shuvroroy:fix/l58-morph-callback-models

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Polymorphic relation constraints previously lost their candidate models and custom builders. Infer the query parameter from bound candidate class-strings and arrays using the shared expression type engine, combine candidate builders, and use the declared relation target for unknown, wildcard, or empty candidates. Preserve Laravel's second callback parameter and incompatible explicit parameter hints.

Covers all six callback-taking morph existence methods and four column-callback shortcuts, named arguments, class-string variables, generic and non-generic custom builders, mixed known/unknown candidates, completion, and diagnostics. Laravel runtime assertions verify the installed framework's callback behavior. Removes completed L58 from the backlog.

Stack: depends on #450 (L57), above #449, #448, and #447. This stacked PR targets upstream main, so its diff includes the unmerged dependencies. The final commit contains L58; merge the dependencies first.

Validation: full cargo test, both required clippy runs, cargo fmt --check, PHP syntax/runtime assertions, and Laravel analysis with exactly its three intentional diagnostics.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 96.00000% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/type_engine/variable/closure_resolution.rs 93.65% 8 Missing ⚠️
...engine/variable/forward_walk/callable_inference.rs 97.56% 2 Missing ⚠️
src/virtual_members/laravel/builder.rs 98.38% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants