You are here

public static function TemperatureUnit::getLabels in Physical Fields 8

Gets the labels for the defined units.

Return value

array An array of labels keyed by unit.

Overrides UnitInterface::getLabels

File

src/TemperatureUnit.php, line 17

Class

TemperatureUnit
Provides common temperature units.

Namespace

Drupal\physical

Code

public static function getLabels() {
  return [
    self::KELVIN => t('K'),
    self::CELSIUS => t('°C'),
    self::FAHRENHEIT => t('°F'),
  ];
}