|
@@ -26,15 +26,15 @@ class Temperature extends AbstractUnit implements ConvertableInterface {
|
|
|
* {@inheritDoc}
|
|
|
* @todo support conversion from other types, not just celcius
|
|
|
*/
|
|
|
- public function convertTo(string $unit): self {
|
|
|
+ public function convertTo(string $unit): ConvertableInterface {
|
|
|
switch ($unit) {
|
|
|
- case UNIT_FAHRENHEIT:
|
|
|
+ case self::UNIT_FAHRENHEIT:
|
|
|
return $this->mul(new CustomUnit(
|
|
|
9/5, $unit
|
|
|
))->add(new CustomUnit(
|
|
|
32, $unit
|
|
|
));
|
|
|
- case UNIT_KELVIN:
|
|
|
+ case self::UNIT_KELVIN:
|
|
|
return $this->add(new CustomUnit(
|
|
|
273.15, $unit
|
|
|
));
|