- π«π·France andypost
+++ b/core/lib/Drupal/Core/Extension/Requirement/RequirementInterface.php @@ -0,0 +1,107 @@ + const SEVERITY_OK = 0; ... + const SEVERITY_INFO = -1; ... + const SEVERITY_ERROR = 2; ... + const SEVERITY_WARNING = 1;
Instead of constants it could be enum or even removed in favour of methods (like accessResult doing).
But this weight used only for frontend to group sort requirements - that usage is missing in replacement - First commit to issue fork.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
We could possibly roll this into π Add value objects to represent the return of hook_requirements Needs review
- Merge request !5952Resolve #2909472 "Add Requirement value object and enums" β (Open) created by kim.pepper
- Status changed to Needs review
11 months ago 12:08am 26 December 2023 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Converted to a single
Requirement
class with enums forRequirementSeverity
andRequirementPhase
.Remaining tasks:
- Decide if we should just enforce required properties by using constructor args
- Ensure sorting works
- Replace usages of requirements arrays
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Hiding old patches
- Status changed to Needs work
11 months ago 9:25pm 26 December 2023 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I think this issue is quite large, having to convert all of cores hook requirements to value objects as well as handle deprecations.
We should split out the smaller task of creating enums for RequirementSeverity and RequirementPhase π Create enums for RequirementSeverity and RequirementPhase Active