./core/modules/breakpoint/src/BreakpointInterface.php getLabel() claims to return a string, but returns TranslatableMarkup

Created on 7 July 2025, 7 days ago

Problem/Motivation

According to the documentation of ./core/modules/breakpoint/src/BreakpointInterface.php getLabel(), it claims to return a string.

However in my tests it can return an object of type TranslatableMarkup.

This causes PHPStan to erroneously say that my code is not valid when it expects TranslatableMarkup, not a string, from this function.

Steps to reproduce

Proposed resolution

State in the documentation of ./core/modules/breakpoint/src/BreakpointInterface.php getLabel() that it does not necessarily return a string but can return TranslatableMarkup.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.2 🔥

Component

breakpoint.module

Created by

🇨🇦Canada alberto56

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

Comments & Activities

Production build 0.71.5 2024