| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class Temperature |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * the temperature stored as kelvin |
||
| 9 | */ |
||
| 10 | private $kelvin; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Temperature constructor. |
||
| 14 | * @param $kelvin |
||
| 15 | */ |
||
| 16 | public function __construct($kelvin) |
||
| 17 | { |
||
| 18 | $this->kelvin = $kelvin; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * converts the temperature to degree celsius |
||
| 23 | * @return float |
||
| 24 | */ |
||
| 25 | public function toDegreeCelsius() |
||
| 26 | { |
||
| 27 | return $this->kelvin - 273.15; |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * converts the temperature to kelvin |
||
| 32 | * @return float |
||
| 33 | */ |
||
| 34 | public function toKelvin() |
||
| 37 | } |
||
| 38 | } |