Util::removeHtmlComments can return both string and MarkupInterface

Created on 25 January 2024, about 1 year ago
Updated 8 February 2024, about 1 year ago

Problem/Motivation

When an empty string is passed through Util::removeHtmlComments, MarkupInterface::create will return an empty string and not a MarkupInterface instance

TypeError: Drupal\sdc_display\Util::removeHtmlComments(): Return value must be of type Drupal\Component\Render\MarkupInterface, string returned in Drupal\sdc_display\Util::removeHtmlComments() (line 63 of modules/contrib/sdc_display/src/Util.php).

Proposed resolution

Fix the method signature and comments to reflect the right returns.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain pcambra Asturies

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