9 [4/4]. Name the member every report is made from - #76
Conversation
`_doing_it_wrong()`'s first argument came in two shapes: `Class::method` at the facade's two trampolines and at the too-late boot, and a bare class name at the six other sites. WordPress prints it as "Function %s was called incorrectly", so it is the only part of a report that says where in the library the sentence came from -- and a bare class cannot separate two reports made by the same class, which is exactly what `Absorber::render_notices` and `Absorber::filter_activation_error_markup` are, and what `Loader::load_all` and `Loader::load` are. `Class::method` everywhere. Written as `self::class . '::method'` rather than `__METHOD__`, because `Traits\Guards_Hook_Prefix` is reported through by four classes and `__METHOD__` inside a trait method names the trait rather than the class using it -- a host would be sent to the trait instead of to the facade, the load pass or the conflict pass that actually stood down. The too-late boot keeps naming `Absorber::boot`: the mistake there is in a call the host made, and that is the call it has to move. `AGENTS.md` states the rule under Conventions, so the next report site has one shape to copy rather than two to choose from, and `WithIncorrectUsage::assert_the_library_reported_incorrect_usage()` enforces it across the suite -- the shape, not the member name, so a rename still passes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change updates ChangesDiagnostic identifier consistency
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The PR standardizes incorrect-usage reports to identify the specific class member that emitted each message; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 6 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
09d2af7 to
752553f
Compare
c71c933 to
fb9503c
Compare
6d543f7 to
aa7fd99
Compare
fb9503c to
231b9d8
Compare
aa7fd99 to
39a2196
Compare
231b9d8 to
1b94db1
Compare
What: one shape for
_doing_it_wrong()'s first argument across every report site in the library —Class::method, never a bare class name — with the rule stated inAGENTS.mdand enforced byWithIncorrectUsage.Usage: a host reading a debug log now gets
instead of
Function Nexcess\PluginAbsorber\Loader was called incorrectly, which read identically whether the load pass abandoned a sub-plugin or the file gate refused one.Why this way:
The member is the only thing separating two reports from one class.
Absorberreports from two static trampolines andLoaderfrom two methods; a bare class name collapses all four into one attribution, and the message is then the only way to tell them apart.self::class . '::method', not__METHOD__.__METHOD__inside a trait method names the trait, so the prefix guard would attribute toTraits\Guards_Hook_Prefixrather than to the class that actually stood down.The too-late boot still names
Absorber::boot. Every other site names where the sentence was written; that one names the call the host got wrong, because moving that call is the fix.The suite pins the shape, not the name. One assertion that a report contains
::refuses a bare class at any new site while leaving method renames free.Summary by CodeRabbit
Bug Fixes
Tests