Created on 15 August 2024, 9 months ago
Updated 16 August 2024, 9 months ago

Problem/Motivation

With PHP 8.1 as a minimum requirement, Enums can replace some current use of class constants.

Remaining tasks

- Determine Enums
- Update code which uses class constants / strings to also handle enum

API changes

Methods will accept emum in addition to strings

Data model changes

🌱 Plan
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada gapple

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

Comments & Activities

  • Issue created by @gapple
  • 🇨🇦Canada gapple

    Enumable things
    - Directives (default-src, script-src)
    - Directive Schemas (source-list, ancestor-source-list, token-list)
    - Keywords ('self', 'none')

    Function type hints may cause some problems, where they're currently typehinted to string, and would need to change to string|enum.
    2.x could accept both where possible, and translate to strings where necessary. 3.x can widen type hints to string|enum, 4.x could narrow them to enum where appropriate.

Production build 0.71.5 2024