Repository navigation
Keep consumer-a's hook-free code in includes, as the template does - #61
Merged
Merged
Conversation
consumer-a kept its footprint and migration steps as final classes in src/, beside its composition root and components, though neither registers a hook or joins the component tree. The template now keeps src/ for that tree alone and puts such code in includes/, and consumer-a is the anatomy the template adopts, so the two would drift apart. Footprint and Migrations become includes/footprint.php and includes/migrations.php, a typed footprint function and the step list with its step, which the includes loader requires. uninstall.php requires the footprint by path, and the uninstall row that removes the footprint now removes that file. Both files parse on PHP 7.4, which the consumer-a syntax job checks. Assisted-by: Claude Code:claude-opus-5-5
Convention 6 put the logic that global functions or templates need in static methods of final classes, and convention 8 named an Options class and its text() method, while the template and consumer-a now keep src/ for the composition root and its components and put option keys and readers, the footprint, migration steps and asset registrars in includes/. Convention 6 states that layout, and convention 8 names the plugin's prefixed option constants and its text reader. The rule that packages ship no free functions is unchanged. Assisted-by: Claude Code:claude-opus-5-5
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.
Summary. The plugin template now keeps
src/for its composition root and components and puts the code that registers no hooks inincludes/. consumer-a, the anatomy the template adopts, still kept its footprint and migration steps as final classes insrc/, and conventions 6 and 8 still described anOptionsclass and final-class helpers. consumer-a and both conventions now match the template.acme_ca_get_footprint()inincludes/footprint.phpandacme_ca_get_migration_steps()with its step inincludes/migrations.phpreplaceFootprint::DATAandMigrations::STEPS;uninstall.phprequires the footprint by path, and both files parse on PHP 7.4.src/holds a plugin's composition root and components, and hook-free code is prefixed functions and constants inincludes/; convention 8 names the plugin's prefixed option constants and its text reader.Fixtures +80 −111 (6 files), tests +1 −1, AGENTS.md +2 −2.
Review points.
@returnshape keeps PHPStan's check of the footprint, which arequired array file would lose.Migrations::STEPS: a persona shows the package's API, not the plugin anatomy.Testing.
composer quality-checkpasses: validate, changelog validation, PHPCS on both profiles, the PHPStan profiles and every fixture's, Unit 189 and Integration 1333.composer test:integration:multisitepasses: 40.composer test:integration:lowestpasses: 33.includes/footprint.php; hand mutants (a footprint kind removed, the footprint's require dropped) fail the build or a row.