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/NeededAngelTypes_model.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'includes/model/NeededAngelTypes_model.php') diff --git a/includes/model/NeededAngelTypes_model.php b/includes/model/NeededAngelTypes_model.php index 8d6b8cce..96ceca83 100644 --- a/includes/model/NeededAngelTypes_model.php +++ b/includes/model/NeededAngelTypes_model.php @@ -14,10 +14,11 @@ function NeededAngelTypes_by_shift($shiftId) { AND `count` > 0 ORDER BY `room_id` DESC "); - if ($needed_angeltypes_source === false) + if ($needed_angeltypes_source === false) { return false; - - // Use settings from room + } + + // Use settings from room if (count($needed_angeltypes_source) == 0) { $needed_angeltypes_source = sql_select(" SELECT `NeededAngelTypes`.*, `AngelTypes`.`name`, `AngelTypes`.`restricted` @@ -28,15 +29,17 @@ function NeededAngelTypes_by_shift($shiftId) { AND `count` > 0 ORDER BY `room_id` DESC "); - if ($needed_angeltypes_source === false) + if ($needed_angeltypes_source === false) { return false; + } } - $needed_angeltypes = array(); + $needed_angeltypes = []; foreach ($needed_angeltypes_source as $angeltype) { $shift_entries = ShiftEntries_by_shift_and_angeltype($shiftId, $angeltype['angel_type_id']); - if ($shift_entries === false) + if ($shift_entries === false) { return false; + } $angeltype['taken'] = count($shift_entries); $needed_angeltypes[] = $angeltype; -- cgit v1.2.3-70-g09d2