Repository navigation
Expose validation callbacks and restorable URL overrides - #731
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
PR Summary by QodoExpose validation callbacks and restorable URL overrides
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships |
Problem and change
Closure validation rules hide their callback even though Laravel exposes it publicly. Restore public access so tools inspecting parsed validation rules can read the original closure.
Temporary URL origins and route defaults cannot currently be restored without reading protected state or saving resolved values that can override later resolver results. Add
getForcedOrigin(),getForcedAssetOrigin(), andgetDefaultParameterOverrides()so callers can save and restore their values through the existing setters. Document this usage and correct the documented precedence of request defaults. No URL generation or coroutine storage behavior changes.Also clarify the repository's user documentation style guidance.
Fixes #729. Addresses discussion #730.
Supporting evidence
The new parser regression fails with
Cannot access protected property ClosureValidationRule::$callbackbefore the visibility fix and passes afterwards. URL tests cover restoration of absent, empty, and explicit origins, dynamic resolvers, asset origins, and request defaults without capturing worker or resolved defaults.Verification
composer analyse— passed, including type fixtures and the application skeleton.composer test:parallel -- --processes=4 tests/Validation— 1,995 tests passed.composer test:parallel -- --processes=4 tests/Routing— 585 tests passed.composer lint:fix— passed; no formatting changes required.git diff --check— passed.Both changed test files also passed individually during implementation. The URL facade annotations were regenerated with
composer facade 'Hypervel\Support\Facades\URL'.Note
Add getters for URL origin overrides and expose closure validation callbacks
UrlGenerator::getForcedOrigin,getForcedAssetOrigin, andgetDefaultParameterOverrides, which read the current coroutine's overrides fromCoroutineContextand returnnullor an empty array when unset. Adds matching static annotations to theURLfacade.ClosureValidationRule::$callbackpublic so callers holding an exploded rule can access the original closure.ClosureValidationRule::$callbackvisibility changes from protected to public in ClosureValidationRule.php.Macroscope summarized 46c81fd.