Type error prepared tag element with empty content.

Created on 25 January 2023, over 1 year ago

PreparedTagElement::getContent() and ::getSource() declare a return type of MarkupInterface.

But if the content or source are empty strings (which can happen with empty tags), they will return Markup::create(""), which returns an empty string instead of a Markup instance.

All functions that return the result of Markup::create($x), where $x can be an empty string, must declare a return type of MarkupInterface|string or mixed.

πŸ› Bug report
Status

Fixed

Version

5.0

Component

Core

Created by

πŸ‡¨πŸ‡­Switzerland cburschka

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

Comments & Activities

Production build 0.69.0 2024