function FontFamily::setConfiguration

Same name and namespace in other branches
  1. main core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/FontFamily.php \Drupal\Core\Theme\Plugin\DesignTokenValue\FontFamily::setConfiguration()

Sets the configuration for this plugin instance.

The provided configuration is merged with the plugin's default configuration. If the same configuration key exists in both configurations, then the value in the provided configuration will override the default.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Return value

$this

Overrides ConfigurableTrait::setConfiguration

File

core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/FontFamily.php, line 38

Class

FontFamily
Font family design token value.

Namespace

Drupal\Core\Theme\Plugin\DesignTokenValue

Code

public function setConfiguration(array $configuration) : static {
  parent::setConfiguration($configuration);
  if (is_array($this->configuration['value'])) {
    $this->value = $this->configuration['value'];
  }
  elseif (is_string($this->configuration['value'])) {
    $this->value = [
      $this->configuration['value'],
    ];
  }
  return $this;
}

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