Add value objects to represent the return of hook_requirements

Created on 17 September 2017, over 7 years ago
Updated 26 December 2023, 12 months ago

Problem/Motivation

In IRC the other day I was chatting with @realityloop who was getting some notices on admin pages because a module installed on his site was incorrectly returning from hook_requirements.
The module didn't provide a title in the return, and this was causing a large number of warnings, because by default we assume this is present in a uasort call.

Proposed resolution

Replace the return value of hook_requirements with value objects. This will enforce the structure of the return in a way that an array cannot.
Implement \ArrayAccess for BC sake

Remaining tasks

Remaining tasks:

  • Decide if we should just enforce required properties by using constructor args
  • Ensure sorting works
  • Replace usages of requirements arrays

User interface changes

API changes

Addition of a new value object

Data model changes

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 9 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024