function DesignToken::toDtcg

File

core/lib/Drupal/Core/Theme/DesignToken/DesignToken.php, line 70

Class

DesignToken
A token: distinguishable by containing a $value property.

Namespace

Drupal\Core\Theme\DesignToken

Code

public function toDtcg() : array {
  $data = [
    '$type' => $this->type,
    '$value' => $this->value
      ->toDtcg(),
  ];
  if ($this->description) {
    $data['$description'] = $this->description
      ->render();
  }
  return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.