function FontWeight::setConfiguration
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Theme/Plugin/DesignTokenValue/FontWeight.php \Drupal\Core\Theme\Plugin\DesignTokenValue\FontWeight::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/ FontWeight.php, line 39
Class
- FontWeight
- Font weight design token value.
Namespace
Drupal\Core\Theme\Plugin\DesignTokenValueCode
public function setConfiguration(array $configuration) : static {
parent::setConfiguration($configuration);
if ($this->configuration['value'] instanceof FontWeightAlias) {
$this->value = $this->configuration['value']
->value();
return $this;
}
if (is_string($this->configuration['value'])) {
$this->value = FontWeightAlias::from($this->configuration['value'])
->value();
return $this;
}
$this->value = (int) $this->configuration['value'];
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.