Skip to content

19: Give the registry a folder of its own - #33

Open
nikolaystrikhar wants to merge 1 commit into
18-docs-readabilityfrom
19-registry-folder
Open

19: Give the registry a folder of its own#33
nikolaystrikhar wants to merge 1 commit into
18-docs-readabilityfrom
19-registry-folder

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: moves Registrar, Registry_Reader and Contracts\Registrar_Interface into src/Registry/, renaming the reader to Registry\Reader. No behaviour changes, no hook or priority moves.

Usage:

use Nexcess\PluginAbsorber\Registry\Contracts\Registrar_Interface;

$container->singleton( Registrar_Interface::class, My_Registrar::class );

Why this way:

The folder carries the subject, the class carries the job. The same arrangement Conflict\ and Notices\ already have — two classes on one subject, with the interface in that folder's Contracts\ rather than in the top-level catch-all.

Only the reader is renamed. Registry\Reader, because the folder now spells the half its old name was carrying. Registrar keeps its name: Registry\Store reads better in isolation but collides with Notices\Store in the two files that name both, and renaming a host seam is free only until 1.0.0 tags.

The two classes that hold and read the registered sub-plugins sat in the root
of src/ beside the facades, and the interface one of them implements sat in
src/Contracts/ with everything else that happened not to have a folder. They
are now src/Registry/: Registrar, Reader and Contracts/Registrar_Interface,
which is the arrangement Conflict/ and Notices/ already have -- the folder
carries the subject, the class carries the job.

Only Registry_Reader is renamed, to Registry\Reader, because the folder now
says the half its old name was spelling out. Registrar keeps its name and so
does Registrar_Interface: the alternative that reads better in isolation,
Registry\Store, collides with Notices\Store in the two files that name both,
and renaming a host seam is free only until 1.0.0 tags.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant