Declare that TextTokenInterface and TextValueInterface implement \Stringable

Created on 4 April 2024, 5 months ago
Updated 21 April 2024, 5 months ago

Problem/Motivation

As discussed in #3428603-10: Declare that ConditionGroupInterface or ConditionGroup implements \Stringable , TextTokenInterface and TextValueInterface both declare a __toString() function, and should be relied upon to do that, but they don't implement the \Stringable interface to make that clear.

Proposed resolution

Add the : string return typehints to the __toString() functions in TextToken and TextValue

Add the \Stringable interface to TextTokenInterface and TextValueInterface. Note that \Stringable was added in PHP 8.0, so referencing it will be an implicit dependency on PHP 8.0 or higher. However, that should be fine, as the .info.yml files in the 8.x-1.x branch dropped support for Drupal 9 in 📌 Drop support for Drupal 9 Fixed (committed 2023-11-11), and Drupal core dropped support for PHP 7 starting with 9.4 (i.e.: Drupal ^9.4, ^10, and ^11 all require at least PHP 8.0).

Remaining tasks

  1. Review and feedback
  2. RTBC and feedback
  3. Commit
Feature request
Status

Fixed

Version

1.0

Component

Framework

Created by

🇨🇦Canada mparker17 UTC-4

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024