// in core or cast them.
$value =
new AttributeArray($name,
$value);
} elseif (is_bool($value)) { $value =
new AttributeBoolean($name,
$value);
} // As a development aid, we allow the value to be a safe string object.
elseif ($value instanceof MarkupInterface
) { // Attributes are not supposed to display HTML markup, so we just convert
// the value to plain text.
$value = PlainTextOutput::
renderFromHtml($value);
$value =
new AttributeString($name,
$value);
} elseif (!
is_object($value)) { $value =
new AttributeString($name,
$value);
} return $value;
} /**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]