9A. Report a require that left the guard constant undefined - #68
Open
nikolaystrikhar wants to merge 1 commit into
Open
9A. Report a require that left the guard constant undefined#68nikolaystrikhar wants to merge 1 commit into
nikolaystrikhar wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
What:
Loader::load()verifies the guard constant after therequire_onceand reports a missing one down both channels ofTraits\Reports_Errors—_doing_it_wrong()and{prefix}/plugin_absorber/error— leavingloaded, the activation callback and every skip reason untouched.Usage:
Why this way:
A guard nothing checks is a guarantee nobody has. The constant was only ever read before the require. A typo in the key, or a bundled plugin defining its constant from its own
plugins_loadedcallback, left the code in memory with no load guard — and the re-declaration fatal one activation away, while every counter said the load went perfectly.A report, not a skip. The require happened and cannot be undone: the code is in memory, so the activation callback must still run and
loadedmust still fire. Announcing a skip would tell a host that running code is not there.The name only ever arrives as a value.
Sub_Pluginowns it, so no literal constant name enterssrc/for Strauss'sconstant_prefixto rewrite.