From 2f8a69b774d5fe460017285ffdfd67d10ae7b14b Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sun, 11 Feb 2018 20:50:48 -0600 Subject: [PATCH] Undo casting time types to Time object #189 --- app/Models/Flight.php | 8 ++++---- app/Models/Pirep.php | 16 ++++++++-------- tests/PIREPTest.php | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 9c4df030..3106f487 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -114,26 +114,26 @@ class Flight extends BaseModel /** * @return Time */ - public function getFlightTimeAttribute() + /*public function getFlightTimeAttribute() { if (!array_key_exists('flight_time', $this->attributes)) { return null; } return new Time($this->attributes['flight_time']); - } + }*/ /** * @param $value */ - public function setFlightTimeAttribute($value) + /*public function setFlightTimeAttribute($value) { if ($value instanceof Time) { $this->attributes['flight_time'] = $value->getMinutes(); } else { $this->attributes['flight_time'] = $value; } - } + }*/ /** * Relationship diff --git a/app/Models/Pirep.php b/app/Models/Pirep.php index 956a2c02..19a04b3e 100644 --- a/app/Models/Pirep.php +++ b/app/Models/Pirep.php @@ -141,26 +141,26 @@ class Pirep extends BaseModel /** * @return Time */ - public function getFlightTimeAttribute() + /*public function getFlightTimeAttribute() { if (!array_key_exists('flight_time', $this->attributes)) { return null; } return new Time($this->attributes['flight_time']); - } + }*/ /** * @param $value */ - public function setFlightTimeAttribute($value) + /*public function setFlightTimeAttribute($value) { if($value instanceof Time) { $this->attributes['flight_time'] = $value->getMinutes(); } else { $this->attributes['flight_time'] = $value; } - } + }*/ /** * Return the planned_distance in a converter class @@ -200,26 +200,26 @@ class Pirep extends BaseModel /** * @return Time */ - public function getPlannedFlightTimeAttribute() + /*public function getPlannedFlightTimeAttribute() { if (!array_key_exists('planned_flight_time', $this->attributes)) { return null; } return new Time($this->attributes['planned_flight_time']); - } + }*/ /** * @param $value */ - public function setPlannedFlightTimeAttribute($value) + /*public function setPlannedFlightTimeAttribute($value) { if ($value instanceof Time) { $this->attributes['planned_flight_time'] = $value->getMinutes(); } else { $this->attributes['planned_flight_time'] = $value; } - } + }*/ /** * Do some cleanup on the route diff --git a/tests/PIREPTest.php b/tests/PIREPTest.php index f93c380f..4f6b0a99 100644 --- a/tests/PIREPTest.php +++ b/tests/PIREPTest.php @@ -67,7 +67,7 @@ class PIREPTest extends TestCase * Now set the PIREP state to ACCEPTED */ $new_pirep_count = $pirep->pilot->flights + 1; - $original_flight_time = $pirep->pilot->flight_time ; + $original_flight_time = $pirep->pilot->flight_time; $new_flight_time = $pirep->pilot->flight_time + $pirep->flight_time; $this->pirepSvc->changeState($pirep, PirepState::ACCEPTED);