From e965f8d04150fbd17ee1b5fcbca5ae85bbe6d6bd Mon Sep 17 00:00:00 2001 From: msquare Date: Thu, 29 Sep 2016 11:18:17 +0200 Subject: prohibit inline control structures on model and view --- includes/model/ShiftEntry_model.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'includes/model/ShiftEntry_model.php') diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index 6324c3bf..425b92e8 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -51,10 +51,12 @@ function ShiftEntry_update($shift_entry) { */ function ShiftEntry($shift_entry_id) { $shift_entry = sql_select("SELECT * FROM `ShiftEntry` WHERE `id`='" . sql_escape($shift_entry_id) . "'"); - if ($shift_entry === false) + if ($shift_entry === false) { return false; - if (count($shift_entry) == 0) + } + if (count($shift_entry) == 0) { return null; + } return $shift_entry[0]; } @@ -89,8 +91,8 @@ function ShiftEntries_upcoming_for_user($user) { * * @param User $user */ -function ShiftEntries_finished_by_user($user){ - return sql_select(" +function ShiftEntries_finished_by_user($user) { + return sql_select(" SELECT * FROM `ShiftEntry` JOIN `Shifts` ON (`Shifts`.`SID` = `ShiftEntry`.`SID`) -- cgit v1.2.3-54-g00ecf