diff --git a/CHANGELOG.md b/CHANGELOG.md index e136cb7..863b1e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to `unit-conversions` will be documented in this file. +## 1.1.0 - 2021-04-27 + +- Add Temerature Conversion ## 1.0.0 - 2021-04-27 - initial release diff --git a/src/Temerature.php b/src/Temerature.php new file mode 100644 index 0000000..2b80a79 --- /dev/null +++ b/src/Temerature.php @@ -0,0 +1,22 @@ +celsius = $celsius; + } + + public static function forCelsius(float $celsius) : self + { + return new static($celsius); + } + + public function toFahrenheit(): float + { + return ($this->celsius * 1.8) + 32; + } +} diff --git a/tests/TemeratureTest.php b/tests/TemeratureTest.php new file mode 100644 index 0000000..5a79b0e --- /dev/null +++ b/tests/TemeratureTest.php @@ -0,0 +1,15 @@ +toFahrenheit(); + $this->assertEquals(212, $fahrenheit); + } +}