Skip to content

003: The attribute constructors only grow until 2.0

Status: accepted, 2026-11-08.

Context

Plugins of the suite are declared with PHP attributes, and attributes are written with named arguments: #[SiteAdminSection(id: 'menus', scoped_list: new ScopedConfigList(...))]. A parameter name is therefore public API. Renaming or removing one breaks every plugin that uses it at discovery, with "Unknown named parameter", in projects the suite never sees: seven satellite projects declare sections, and so do client modules.

#[SiteAdminSection] has 30 parameters. Three have one user each, all in Sites itself. Others with one or two users sit in satellites (sites_redirect, sites_webform). The value objects a section takes (SectionRoute, SectionCard, SectionAction, ViewListing, ScopedConfigList, ScopedView) are written with named arguments too. #[Site], #[SiteSetting] and #[LaunchStep] follow the same pattern.

Decision

The constructors of #[SiteAdminSection], its six value objects, #[Site], #[SiteSetting] and #[LaunchStep] only grow in 1.x: a new parameter goes at the end and has a default. Renaming, removing or reordering a parameter, or making an optional one required, waits for 2.0. #[Site] plugins stay a supported way to declare a site in code, not a path to retirement.

Consequences

  • AttributeSignatureTest pins each constructor: names, order, optional parameters and types. A new parameter turns it red until the list in the test has it; its failure message says so.
  • Refactoring the section internals (typed getters, how the definition is read) keeps every parameter name.
  • Satellites and client modules need no update hook and no conflict entry for 1.x.

Rejected options

  • Remove the parameters with a single user: saves three lines in the attribute and starts a compatibility discussion with every project that might use them.
  • Group rare parameters into value objects in 1.x: the old names would need to stay as aliases, so every value would have two spellings until 2.0.
  • Section base classes for the common shapes: the suite had twelve and removed them; a section is one class and its attribute. SectionFrameworkIsGoneTest keeps them out.

Reopen when

Planning for 2.0 starts.

Last updated 2026-11-08