From 35fadfc6d66dc88b58205567c0d3cf3bf74292b6 Mon Sep 17 00:00:00 2001 From: jordanbrauer Date: Tue, 10 Oct 2017 14:00:52 -0500 Subject: [PATCH] Fix: using new ::configure() method over explicit value definitions --- src/UnitConverter/Unit/Temperature/Celsius.php | 11 ++++++++--- src/UnitConverter/Unit/Temperature/Fahrenheit.php | 8 +++++--- src/UnitConverter/Unit/Temperature/Kelvin.php | 11 ++++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/UnitConverter/Unit/Temperature/Celsius.php b/src/UnitConverter/Unit/Temperature/Celsius.php index 78c88a8c..b1c127a5 100644 --- a/src/UnitConverter/Unit/Temperature/Celsius.php +++ b/src/UnitConverter/Unit/Temperature/Celsius.php @@ -26,9 +26,14 @@ */ class Celsius extends TemperatureUnit { - protected $name = "celsius"; + protected function configure () + { + $this + ->setName("celsius") - protected $symbol = "c"; + ->setSymbol("c") - protected $units = -272.15; + ->setUnits(-272.15) + ; + } } diff --git a/src/UnitConverter/Unit/Temperature/Fahrenheit.php b/src/UnitConverter/Unit/Temperature/Fahrenheit.php index 6ff75e59..d1654874 100644 --- a/src/UnitConverter/Unit/Temperature/Fahrenheit.php +++ b/src/UnitConverter/Unit/Temperature/Fahrenheit.php @@ -26,9 +26,11 @@ */ class Fahrenheit extends TemperatureUnit { - protected $name = "fahrenheit"; + $this + ->setName("fahrenheit") - protected $symbol = "f"; + ->setSymbol("f") - protected $units = -457.87; + ->setUnits(-457.87) + ; } diff --git a/src/UnitConverter/Unit/Temperature/Kelvin.php b/src/UnitConverter/Unit/Temperature/Kelvin.php index 1ade7d0b..0b27088d 100644 --- a/src/UnitConverter/Unit/Temperature/Kelvin.php +++ b/src/UnitConverter/Unit/Temperature/Kelvin.php @@ -26,9 +26,14 @@ */ class Kelvin extends TemperatureUnit { - protected $name = "kelvin"; + protected function configure () + { + $this + ->setName("kelvin") - protected $symbol = "k"; + ->setSymbol("k") - protected $units = 1; + ->setUnits(1) + ; + } }