•  
      request #44046 Mark overriding methods with attributes
    Infos
    #44046
    Joris MASSON (jmasson)
    2025-07-21 15:22
    2025-07-21 14:29
    45742
    Details
    Mark overriding methods with attributes

    Since request #43700, we can use PHP 8.3 syntax like the Override attribute.

    We should mark recently-introduced overriding methods with this attribute, so that it is clear that the end-of-chain method is actually overriding a parent method. PHP will also raise an error if we delete the parent method, which will warn developers that they must use caution.

    Psalm can also flag missing attributes. Leveraging this, we should enable this setting and commit existing lack of attributes to the baseline. We can then add missing attributes slowly over time when we touch things dealing with inheritance. New usages should apply the override attribute as part of the normal work, not as a separate request.

    Other
    Empty
    Empty
    • [ ] enhancement
    • [x] internal improvement
    Empty
    Stage
    Joris MASSON (jmasson)
    Under review
    Empty
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    Joris MASSON (jmasson)2025-07-21 15:22
    • Summary
      -Mark overriding methods with attributes in Tracker field DAOs 
      +Mark overriding methods with attributes 
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes