Repository navigation
Rebuild the package manifest when retrying provider loading - #265
Conversation
`clearPackageCache()` reset `PackageManifest::$manifest` to an empty array, but `getManifest()` short-circuits on `! is_null()`, so the retry ran against an empty manifest instead of rebuilding it from the installed packages. With `app.loadDiscoveredPackages` enabled that dropped every discovered provider, and swallowed the original exception along with it, so a genuinely broken provider looked like a clean boot.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
Estimated code review effort Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to
|
…essing Laravel annotates `$manifest` as `array`, but the property is untyped, defaults to null, and `getManifest()` treats null as "not built yet".
clearPackageCache()resetPackageManifest::$manifestto[], but Laravel'sgetManifest()short-circuits on! is_null(), so the retry inregisterConfiguredProviders()never rebuilt the manifest. Withapp.loadDiscoveredPackagesenabled it boots with no discovered providers and swallows the original exception instead of reporting it. Resetting tonull, the unbuilt state, fixes both.phpstan flags the assignment because Laravel annotates the untyped
$manifestas@var array; corrected intests/stubs/PackageManifest.stubrather than suppressed.Tests:
tests/Foundation/PackageCacheTest.php, three tests, all failing without the fix. Two of them need #255 to run onwip/1.3.Broken since 6eef811 (octobercms/library#492).
app.loadDiscoveredPackagesdefaults tofalse, so only opt-in installs are affected.