Skip to content

Drop brightnucleus/config for direct registration#45

Merged
GaryJones merged 2 commits into
mainfrom
GaryJones/remove-brightnucleus
Jun 11, 2026
Merged

Drop brightnucleus/config for direct registration#45
GaryJones merged 2 commits into
mainfrom
GaryJones/remove-brightnucleus

Conversation

@GaryJones

Copy link
Copy Markdown
Owner

The boilerplate carried brightnucleus/config to do one small thing: load config/defaults.php and hand its nested values back through getConfigKey(). None of the library's real value — schema validation, required keys — was used, and every accessor returned mixed, which is what pinned static analysis at level 8. It also modelled a configuration-driven pattern that the production plugins this repo points people to, Co-Authors Plus, MSM Sitemap, Liveblog among them, simply do not use.

So the example settings page, setting, section and field are now registered directly against the WordPress API, with typed methods and constants in the Plugin class. The plugin file passes its own path in rather than defining global constants, and the class derives its directory and URL from it. With the untyped boundary gone, PHPStan moves up to its maximum level with no baseline, and composer/installers is left as the only runtime dependency.

The test suite is rebuilt around the new surface — exact arguments to each registration call, the captured render callbacks invoked against fixtures, the sanitiser, and the asset enqueuing — holding mutation coverage at 100%.

The config package only loaded a PHP array and handed its values back as
mixed, which capped static analysis at level 8 and modelled a pattern the
production plugins this repo points to do not use. The Plugin now
registers its example page, setting and field straight against the
WordPress API, fully typed, leaving composer/installers as the only
runtime dependency.
With the mixed-returning config accessors gone, the source analyses clean
at max with no baseline.
@GaryJones GaryJones merged commit 6211093 into main Jun 11, 2026
4 checks passed
@GaryJones GaryJones deleted the GaryJones/remove-brightnucleus branch June 11, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant