Documentation

Measure

A static class containing constants that define the available default types of measurements & the units they govern.

Tags
version
1.0.0
since
0.0.1
author

Jordan Brauer 18744334+jordanbrauer@users.noreply.github.com

codeCoverageIgnore

Table of Contents

AREA  = "area"
DIGITAL_STORAGE  = "digital_storage"
ENERGY  = "energy"
FREQUENCY  = 'frequency'
FUEL_ECONOMY  = 'fuel_economy'
LENGTH  = "length"
MASS  = "mass"
PLANE_ANGLE  = "plane_angle"
PRESSURE  = "pressure"
SPEED  = "speed"
TEMPERATURE  = "temperature"
TIME  = "time"
VOLUME  = "volume"
$defaultMeasurements  : array<string|int, mixed>
An array containing a list of default measurement types that are supported, and the unit classes they govern.
getDefaultMeasurements()  : array<string|int, mixed>
Return a list of all default supported measurement types. These types govern unit's of measurement.
getDefaultUnitsFor()  : array<string|int, mixed>
Return a list of all default supported units for a given type of measurement.

Constants

DIGITAL_STORAGE

public mixed DIGITAL_STORAGE = "digital_storage"

ENERGY

public mixed ENERGY = "energy"

FREQUENCY

public mixed FREQUENCY = 'frequency'

FUEL_ECONOMY

public mixed FUEL_ECONOMY = 'fuel_economy'

LENGTH

public mixed LENGTH = "length"

PLANE_ANGLE

public mixed PLANE_ANGLE = "plane_angle"

PRESSURE

public mixed PRESSURE = "pressure"

TEMPERATURE

public mixed TEMPERATURE = "temperature"

VOLUME

public mixed VOLUME = "volume"

Properties

$defaultMeasurements

An array containing a list of default measurement types that are supported, and the unit classes they govern.

private static array<string|int, mixed> $defaultMeasurements = [self::LENGTH => [UnitConverterUnitLengthAstronomicalUnit::class, UnitConverterUnitLengthCentimetre::class, UnitConverterUnitLengthDecimetre::class, UnitConverterUnitLengthFoot::class, UnitConverterUnitLengthHand::class, UnitConverterUnitLengthInch::class, UnitConverterUnitLengthKilometre::class, UnitConverterUnitLengthLightyear::class, UnitConverterUnitLengthMetre::class, UnitConverterUnitLengthMicrometre::class, UnitConverterUnitLengthMile::class, UnitConverterUnitLengthMillimetre::class, UnitConverterUnitLengthNanometre::class, UnitConverterUnitLengthParsec::class, UnitConverterUnitLengthPicometre::class, UnitConverterUnitLengthYard::class], self::AREA => [UnitConverterUnitAreaAcre::class, UnitConverterUnitAreaHectare::class, UnitConverterUnitAreaSquareCentimetre::class, UnitConverterUnitAreaSquareFoot::class, UnitConverterUnitAreaSquareKilometre::class, UnitConverterUnitAreaSquareMetre::class, UnitConverterUnitAreaSquareMile::class, UnitConverterUnitAreaSquareMillimetre::class], self::VOLUME => [UnitConverterUnitVolumeCubicMetre::class, UnitConverterUnitVolumeGallon::class, UnitConverterUnitVolumeLitre::class, UnitConverterUnitVolumeMillilitre::class, UnitConverterUnitVolumePint::class], self::MASS => [UnitConverterUnitMassGram::class, UnitConverterUnitMassKilogram::class, UnitConverterUnitMassLongTon::class, UnitConverterUnitMassMilligram::class, UnitConverterUnitMassNewton::class, UnitConverterUnitMassOunce::class, UnitConverterUnitMassPound::class, UnitConverterUnitMassShortTon::class, UnitConverterUnitMassStone::class, UnitConverterUnitMassTonne::class], self::SPEED => [UnitConverterUnitSpeedKilometrePerHour::class, UnitConverterUnitSpeedMetrePerSecond::class, UnitConverterUnitSpeedMilePerHour::class], self::PLANE_ANGLE => [UnitConverterUnitPlaneAngleDegree::class, UnitConverterUnitPlaneAngleRadian::class], self::TEMPERATURE => [UnitConverterUnitTemperatureCelsius::class, UnitConverterUnitTemperatureFahrenheit::class, UnitConverterUnitTemperatureKelvin::class], self::PRESSURE => [UnitConverterUnitPressureAtmosphere::class, UnitConverterUnitPressureBar::class, UnitConverterUnitPressureHectopascal::class, UnitConverterUnitPressureInchesOfMercury::class, UnitConverterUnitPressureKilopascal::class, UnitConverterUnitPressureMegapascal::class, UnitConverterUnitPressureMillibar::class, UnitConverterUnitPressurePascal::class, UnitConverterUnitPressurePoundForcePerSquareInch::class, UnitConverterUnitPressureTorr::class], self::TIME => [UnitConverterUnitTimeDay::class, UnitConverterUnitTimeHour::class, UnitConverterUnitTimeMicrosecond::class, UnitConverterUnitTimeMillisecond::class, UnitConverterUnitTimeMinute::class, UnitConverterUnitTimeMonth::class, UnitConverterUnitTimeNanosecond::class, UnitConverterUnitTimeSecond::class, UnitConverterUnitTimeWeek::class, UnitConverterUnitTimeYear::class], self::ENERGY => [UnitConverterUnitEnergyCalorie::class, UnitConverterUnitEnergyFootPound::class, UnitConverterUnitEnergyJoule::class, UnitConverterUnitEnergyKilojoule::class, UnitConverterUnitEnergyKilowattHour::class, UnitConverterUnitEnergyMegaelectronvolt::class, UnitConverterUnitEnergyMegajoule::class, UnitConverterUnitEnergyMegawattHour::class, UnitConverterUnitEnergyNewtonMetre::class, UnitConverterUnitEnergyWattHour::class], self::FREQUENCY => [UnitConverterUnitFrequencyHertz::class, UnitConverterUnitFrequencyKilohertz::class, UnitConverterUnitFrequencyMegahertz::class, UnitConverterUnitFrequencyGigahertz::class, UnitConverterUnitFrequencyTerahertz::class, UnitConverterUnitFrequencyMillihertz::class], self::DIGITAL_STORAGE => [UnitConverterUnitDigitalStorageBit::class, UnitConverterUnitDigitalStorageKilobit::class, UnitConverterUnitDigitalStorageMegabit::class, UnitConverterUnitDigitalStorageGigabit::class, UnitConverterUnitDigitalStorageTerabit::class, UnitConverterUnitDigitalStorageKibibit::class, UnitConverterUnitDigitalStorageMebibit::class, UnitConverterUnitDigitalStorageGibibit::class, UnitConverterUnitDigitalStorageTebibit::class, UnitConverterUnitDigitalStorageKilobyte::class, UnitConverterUnitDigitalStorageMegabyte::class, UnitConverterUnitDigitalStorageGigabyte::class, UnitConverterUnitDigitalStorageTerabyte::class], self::FUEL_ECONOMY => [UnitConverterUnitFuelEconomyKilometrePerLitre::class, UnitConverterUnitFuelEconomyLitrePer100Kilometres::class, UnitConverterUnitFuelEconomyMilesPerGallon::class]]

Methods

getDefaultMeasurements()

Return a list of all default supported measurement types. These types govern unit's of measurement.

public static getDefaultMeasurements() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDefaultUnitsFor()

Return a list of all default supported units for a given type of measurement.

public static getDefaultUnitsFor(string $measurement) : array<string|int, mixed>
Parameters
$measurement : string

The measurement type to retrieve units for.

Return values
array<string|int, mixed>

Search results