diff --git a/core/lib/Drupal/Core/Template/Attribute.php b/core/lib/Drupal/Core/Template/Attribute.php index c165981..c51e4d7 100644 --- a/core/lib/Drupal/Core/Template/Attribute.php +++ b/core/lib/Drupal/Core/Template/Attribute.php @@ -252,7 +252,7 @@ public function hasClass($class) { */ public function __toString() { $keys = ''; - $values = array(); + $values = []; foreach ($this->storage as $name => $value) { $rendered = $value->render(); if ($rendered) { @@ -261,7 +261,7 @@ public function __toString() { } } - if(!$rendered){ + if (!$rendered) { return ''; } return SafeMarkup::format($keys, $values); diff --git a/core/lib/Drupal/Core/Template/AttributeValueBase.php b/core/lib/Drupal/Core/Template/AttributeValueBase.php index de87f7b..b1f0898 100644 --- a/core/lib/Drupal/Core/Template/AttributeValueBase.php +++ b/core/lib/Drupal/Core/Template/AttributeValueBase.php @@ -57,7 +57,7 @@ public function __construct($name, $value) { public function render() { $value = (string) $this; if (isset($this->value) && static::RENDER_EMPTY_ATTRIBUTE || !empty($value)) { - return SafeMarkup::format("@name = '@value'", ['@name' => $this->name, '@value' => $value]); + return SafeMarkup::format('@name="@value"', ['@name' => $this->name, '@value' => $value]); } }