@@ -55,11 +55,13 @@ discard block |
||
| 55 | 55 | foreach ($events['all'] as $event) { |
| 56 | 56 | $date = date('Y-m-d', strtotime($event->eventTime)); |
| 57 | 57 | if ($event->object->{'@type'} == 'SoftwareApplication') { |
| 58 | - if (array_key_exists($date, $cas_events)) |
|
| 59 | - array_push($cas_events[$date], $event); |
|
| 58 | + if (array_key_exists($date, $cas_events)) { |
|
| 59 | + array_push($cas_events[$date], $event); |
|
| 60 | + } |
|
| 60 | 61 | } else { |
| 61 | - if (array_key_exists($date, $moodle_events)) |
|
| 62 | - array_push($moodle_events[$date], $event); |
|
| 62 | + if (array_key_exists($date, $moodle_events)) { |
|
| 63 | + array_push($moodle_events[$date], $event); |
|
| 64 | + } |
|
| 63 | 65 | } |
| 64 | 66 | } |
| 65 | 67 | |
@@ -129,8 +131,10 @@ discard block |
||
| 129 | 131 | |
| 130 | 132 | $events = Klass::eventsForUser($id, self::loggedUser()); |
| 131 | 133 | |
| 132 | - if ($events != null) |
|
| 133 | - usort($events, function($a, $b) {return $a->eventTime < $b->eventTime;}); |
|
| 134 | + if ($events != null) { |
|
| 135 | + usort($events, function($a, $b) {return $a->eventTime < $b->eventTime; |
|
| 136 | + } |
|
| 137 | + }); |
|
| 134 | 138 | |
| 135 | 139 | return $this->render('User/class.twig', [ |
| 136 | 140 | 'class' => $class, |
@@ -157,13 +161,14 @@ discard block |
||
| 157 | 161 | $res[$i]['date'] = $result->date; |
| 158 | 162 | $res[$i]['score'] = $result->score; |
| 159 | 163 | foreach ($lineItems as $lineItem) { |
| 160 | - if ($lineItem->sourcedId == $result->lineitem->sourcedId) |
|
| 161 | - $res[$i]['title'] = $lineItem->title; |
|
| 164 | + if ($lineItem->sourcedId == $result->lineitem->sourcedId) { |
|
| 165 | + $res[$i]['title'] = $lineItem->title; |
|
| 166 | + } |
|
| 162 | 167 | } $i++; |
| 163 | 168 | } |
| 164 | 169 | |
| 165 | 170 | return $this->json($res); |
| 166 | - }catch (Exception $e) { |
|
| 171 | + } catch (Exception $e) { |
|
| 167 | 172 | return new Response($e->getMessage(), 404); |
| 168 | 173 | } |
| 169 | 174 | |
@@ -37,8 +37,9 @@ |
||
| 37 | 37 | $res = []; |
| 38 | 38 | |
| 39 | 39 | foreach($students as $student) { |
| 40 | - if ($student['uid'][0] != null) |
|
| 41 | - $res += [ $student['uid'][0] => $student['displayname'][0] ]; |
|
| 40 | + if ($student['uid'][0] != null) { |
|
| 41 | + $res += [ $student['uid'][0] => $student['displayname'][0] ]; |
|
| 42 | + } |
|
| 42 | 43 | } |
| 43 | 44 | |
| 44 | 45 | return $this->json($res); |
@@ -25,10 +25,11 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function index(Request $request) |
| 27 | 27 | { |
| 28 | - if (self::isUp()) |
|
| 29 | - return $this->render('home.twig'); |
|
| 30 | - else |
|
| 31 | - return $this->render('Error/unavailable.twig'); |
|
| 28 | + if (self::isUp()) { |
|
| 29 | + return $this->render('home.twig'); |
|
| 30 | + } else { |
|
| 31 | + return $this->render('Error/unavailable.twig'); |
|
| 32 | + } |
|
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | /** |