Problem/Motivation
Many hook_requirements implementations have dependencies that are not explicit, and are difficult to test due to a lack of dependency injection.
Steps to reproduce
N/A
Proposed resolution
hook_requirements should be split into 3 values.
hook_runtime_requirements can stay a hook, OOP hooks can already support it.
Create this hook.
hook_update_requirements can stay a hook, OOP hooks can already support it.
Create this hook.
hook_install_requirements can become a special service provider like class using the methods mentioned here.
Create support for the new class.
For the hooks create an alter.
For the class create an alter method maybe?
Break up module requirements into their new respective locations.
Once this is complete deprecate hook_requirements.
Remaining tasks
Create Child Issues
Create hook_runtime_requirements #3490841: Create hook_runtime_requirements
Create hook_update_requirements #3490842: Create hook_update_requirements
Create hook_install_requirements Class #3490843: Create class to replace hook_install_requirements
Create conversion issue for all 22 files implementing hook_requirements in core #3490845: [pp-3] Convert hook_requirements to new classes or hook_runtime_requirements
Deprecate hook_requirements #3490846: [pp-many] Deprecate hook_requirements
User interface changes
N/A
API changes
Many likely
Data model changes
N/A