Completed
Pull Request — master (#177)
by
unknown
02:53
created
lib.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
  * @uses FEATURE_GRADE_OUTCOMES
104 104
  * @uses FEATURE_SHOW_DESCRIPTION
105 105
  * @param string $feature
106
- * @return mixed True if yes (some features may use other values)
106
+ * @return null|boolean True if yes (some features may use other values)
107 107
  */
108 108
 function bigbluebuttonbn_supports($feature) {
109 109
     if (!$feature) {
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
  *
273 273
  * @param object $bigbluebuttonbn Id of the module instance
274 274
  *
275
- * @return bool Success/Failure
275
+ * @return boolean|null Success/Failure
276 276
  */
277 277
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
278 278
     global $DB;
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
  * @param object $mod
294 294
  * @param object $bigbluebuttonbn
295 295
  *
296
- * @return bool
296
+ * @return string
297 297
  */
298 298
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
299 299
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) {
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
  * @param stdClass $context       context object
870 870
  * @param string   $filearea      file area
871 871
  *
872
- * @return false|null false if file not valid
872
+ * @return boolean false if file not valid
873 873
  */
874 874
 function bigbluebuttonbn_pluginfile_valid($context, $filearea) {
875 875
 
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     $sql = "SELECT COUNT(*) FROM {bigbluebuttonbn_logs} ";
357 357
     $sql .= "WHERE courseid = ? AND bigbluebuttonbnid = ? AND userid = ? AND (log = ? OR log = ?)";
358 358
     $result = $DB->count_records_sql($sql, array($course->id, $bigbluebuttonbn->id, $user->id,
359
-                                              BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
359
+                                                BIGBLUEBUTTONBN_LOG_EVENT_JOIN, BIGBLUEBUTTONBN_LOG_EVENT_PLAYED));
360 360
     return $result;
361 361
 }
362 362
 
@@ -589,12 +589,12 @@  discard block
 block discarded – undo
589 589
     $str  = '<div class="bigbluebuttonbn overview">'."\n";
590 590
     $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
591 591
     $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
592
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
592
+        '">'.$bigbluebuttonbn->name.'</a>'."\n";
593 593
     $str .= '  </div>'."\n";
594 594
     $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
595 595
         '</div>'."\n";
596 596
     $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
597
-      .'</div>'."\n";
597
+        .'</div>'."\n";
598 598
     $str .= '</div>'."\n";
599 599
     return $str;
600 600
 }
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
             'bigbluebuttonbn',
837 837
             $bigbluebuttonbn->id,
838 838
             $bigbluebuttonbn->completionexpected
839
-          );
839
+            );
840 840
     }
841 841
 }
842 842
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 
31 31
 // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility.
32 32
 if (!class_exists('\Firebase\JWT\JWT')) {
33
-    if (file_exists($CFG->libdir.'/php-jwt/src/JWT.php')) {
34
-        require_once($CFG->libdir.'/php-jwt/src/JWT.php');
33
+    if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) {
34
+        require_once($CFG->libdir . '/php-jwt/src/JWT.php');
35 35
     } else {
36
-        require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
36
+        require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
37 37
     }
38 38
 }
39 39
 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
     $CFG->bigbluebuttonbn = array();
42 42
 }
43 43
 
44
-if (file_exists(dirname(__FILE__).'/config.php')) {
45
-    require_once(dirname(__FILE__).'/config.php');
44
+if (file_exists(dirname(__FILE__) . '/config.php')) {
45
+    require_once(dirname(__FILE__) . '/config.php');
46 46
 }
47 47
 
48 48
 /*
@@ -99,19 +99,19 @@  discard block
 block discarded – undo
99 99
         return null;
100 100
     }
101 101
     $features = array(
102
-        (string) FEATURE_IDNUMBER => true,
103
-        (string) FEATURE_GROUPS => true,
104
-        (string) FEATURE_GROUPINGS => true,
105
-        (string) FEATURE_GROUPMEMBERSONLY => true,
106
-        (string) FEATURE_MOD_INTRO => true,
107
-        (string) FEATURE_BACKUP_MOODLE2 => true,
108
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
109
-        (string) FEATURE_COMPLETION_HAS_RULES => true,
110
-        (string) FEATURE_GRADE_HAS_GRADE => false,
111
-        (string) FEATURE_GRADE_OUTCOMES => false,
112
-        (string) FEATURE_SHOW_DESCRIPTION => true,
102
+        (string)FEATURE_IDNUMBER => true,
103
+        (string)FEATURE_GROUPS => true,
104
+        (string)FEATURE_GROUPINGS => true,
105
+        (string)FEATURE_GROUPMEMBERSONLY => true,
106
+        (string)FEATURE_MOD_INTRO => true,
107
+        (string)FEATURE_BACKUP_MOODLE2 => true,
108
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
109
+        (string)FEATURE_COMPLETION_HAS_RULES => true,
110
+        (string)FEATURE_GRADE_HAS_GRADE => false,
111
+        (string)FEATURE_GRADE_OUTCOMES => false,
112
+        (string)FEATURE_SHOW_DESCRIPTION => true,
113 113
     );
114
-    if (isset($features[(string) $feature])) {
114
+    if (isset($features[(string)$feature])) {
115 115
         return $features[$feature];
116 116
     }
117 117
     return null;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
305 305
     global $DB;
306 306
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
307
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
307
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
308 308
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
309 309
     $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
310 310
     bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
326 326
     if ($completed = bigbluebuttonbn_user_complete($course, $user, $bigbluebuttonbn)) {
327 327
         return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
328
-            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string) $completed . ' ' .
328
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
329 329
             get_string('view_message_times', 'bigbluebuttonbn');
330 330
     }
331 331
     return '';
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
  * @return array status array
518 518
  */
519 519
 function bigbluebuttonbn_reset_recordings($courseid) {
520
-    require_once(__DIR__.'/locallib.php');
520
+    require_once(__DIR__ . '/locallib.php');
521 521
     // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true].
522 522
     $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true);
523 523
     // Remove all the recordings.
@@ -586,16 +586,16 @@  discard block
 block discarded – undo
586 586
     if ($bigbluebuttonbn->visible) {
587 587
         $classes = 'class="dimmed" ';
588 588
     }
589
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
590
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
591
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
592
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
593
-    $str .= '  </div>'."\n";
594
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
595
-        '</div>'."\n";
596
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
597
-      .'</div>'."\n";
598
-    $str .= '</div>'."\n";
589
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
590
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
591
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
592
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
593
+    $str .= '  </div>' . "\n";
594
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
595
+        '</div>' . "\n";
596
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
597
+      .'</div>' . "\n";
598
+    $str .= '</div>' . "\n";
599 599
     return $str;
600 600
 }
601 601
 
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
  * @return void
684 684
  **/
685 685
 function bigbluebuttonbn_process_pre_save_instance(&$bigbluebuttonbn) {
686
-    require_once(__DIR__.'/locallib.php');
686
+    require_once(__DIR__ . '/locallib.php');
687 687
     $bigbluebuttonbn->timemodified = time();
688 688
     if ((integer)$bigbluebuttonbn->instance == 0) {
689 689
         $bigbluebuttonbn->meetingid = 0;
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
     if (count($files) == 1) {
872 872
         // Get the first (and only) file.
873 873
         $file = reset($files);
874
-        $filesrc = '/'.$file->get_filename();
874
+        $filesrc = '/' . $file->get_filename();
875 875
     }
876 876
     return $filesrc;
877 877
 }
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
     if (!$filename) {
941 941
         return false;
942 942
     }
943
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
943
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
944 944
     $fs = get_file_storage();
945 945
     $file = $fs->get_file_by_hash(sha1($fullpath));
946 946
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.
brokerlib.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
209 209
     $callbackresponse['status'] = true;
210 210
     $callbackresponse['found'] = true;
211
-    $callbackresponse['published'] = (string) $recording['published'];
211
+    $callbackresponse['published'] = (string)$recording['published'];
212 212
     if (!isset($params['meta']) || empty($params['meta'])) {
213 213
         return $callbackresponse;
214 214
     }
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
             array('HS256')
560 560
         );
561 561
     } catch (Exception $e) {
562
-        $error = 'Caught exception: '.$e->getMessage();
563
-        header('HTTP/1.0 400 Bad Request. '.$error);
562
+        $error = 'Caught exception: ' . $e->getMessage();
563
+        header('HTTP/1.0 400 Bad Request. ' . $error);
564 564
         return;
565 565
     }
566 566
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -590,8 +590,8 @@  discard block
 block discarded – undo
590 590
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, json_encode($meta));
591 591
         header('HTTP/1.0 202 Accepted');
592 592
     } catch (Exception $e) {
593
-        $error = 'Caught exception: '.$e->getMessage();
594
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
593
+        $error = 'Caught exception: ' . $e->getMessage();
594
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
595 595
     }
596 596
 }
597 597
 
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
613 613
     if (!isset($importrecordings[$params['id']])) {
614 614
         $error = "Recording {$params['id']} could not be found. It can not be imported";
615
-        header('HTTP/1.0 404 Not found. '.$error);
615
+        header('HTTP/1.0 404 Not found. ' . $error);
616 616
         return;
617 617
     }
618 618
     $callbackresponse = array('status' => true);
619 619
     $importrecordings[$params['id']]['imported'] = true;
620 620
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
621
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
621
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
622 622
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
623 623
     // Moodle event logger: Create an event for recording imported.
624 624
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
     $action = strtolower($params['action']);
713 713
     $requiredparams = bigbluebuttonbn_broker_required_parameters();
714 714
     if (!array_key_exists($action, $requiredparams)) {
715
-        return 'Action '.$params['action'].' can not be performed.';
715
+        return 'Action ' . $params['action'] . ' can not be performed.';
716 716
     }
717 717
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
718 718
 }
Please login to merge, or discard this patch.
classes/locallib/notifier.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
111 111
      *
112 112
      * @param object $bigbluebuttonbn
113 113
      *
114
-     * @return void
114
+     * @return string
115 115
      */
116 116
     public static function htmlmsg_recording_ready($bigbluebuttonbn) {
117 117
         return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,29 +44,29 @@  discard block
 block discarded – undo
44 44
      * @return string
45 45
      */
46 46
     public static function htmlmsg_instance_updated($msg) {
47
-        $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.
48
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
49
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
50
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
51
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
52
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
53
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
54
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
55
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
56
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
57
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
58
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
59
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
60
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
61
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
62
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
63
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
64
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
65
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
66
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
67
-        $messagetext .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
68
-            $msg->user_name.'('.$msg->user_email.') ';
69
-        $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
47
+        $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' .
48
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
49
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
50
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
51
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
52
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
53
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
54
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
55
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
56
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
57
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
58
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
59
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
60
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
61
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
62
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
63
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
64
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
65
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
66
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
67
+        $messagetext .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
68
+            $msg->user_name . '(' . $msg->user_email . ') ';
69
+        $messagetext .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
70 70
         return $messagetext;
71 71
     }
72 72
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $course = $coursemodinfo->get_course($bigbluebuttonbn->course);
84 84
         $sender = $USER;
85 85
         // Prepare message.
86
-        $msg = (object) array();
86
+        $msg = (object)array();
87 87
         // Build the message_body.
88 88
         $msg->action = $action;
89 89
         $msg->activity_type = '';
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
      * @return void
115 115
      */
116 116
     public static function htmlmsg_recording_ready($bigbluebuttonbn) {
117
-        return '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').
118
-            ' &quot;' . $bigbluebuttonbn->name . '&quot; '.
119
-            get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
117
+        return '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') .
118
+            ' &quot;' . $bigbluebuttonbn->name . '&quot; ' .
119
+            get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
120 120
     }
121 121
 
122 122
     /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                     // Enqueue it.
159 159
                     \core\task\manager::queue_adhoc_task($task);
160 160
                 } catch (Exception $e) {
161
-                    mtrace("Error while enqueuing completion_uopdate_state task. " . (string) $e);
161
+                    mtrace("Error while enqueuing completion_uopdate_state task. " . (string)$e);
162 162
                 }
163 163
             }
164 164
         }
Please login to merge, or discard this patch.
locallib.php 2 patches
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
  * Helper function to retrieve imported recordings from the Moodle database.
307 307
  * The references are stored as events in bigbluebuttonbn_logs.
308 308
  *
309
- * @param string $courseid
309
+ * @param integer $courseid
310 310
  * @param string $bigbluebuttonbnid
311 311
  * @param bool   $subset
312 312
  *
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 /**
335 335
  * Helper function to retrive the default config.xml file.
336 336
  *
337
- * @return string
337
+ * @return null|SimpleXMLElement
338 338
  */
339 339
 function bigbluebuttonbn_get_default_config_xml() {
340 340
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
  * @param object $a
417 417
  * @param object $b
418 418
  *
419
- * @return array
419
+ * @return integer
420 420
  */
421 421
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
422 422
     global $CFG;
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
  * @param string $data
531 531
  * @param string $contenttype
532 532
  *
533
- * @return object
533
+ * @return null|SimpleXMLElement
534 534
  */
535 535
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
536 536
     if (extension_loaded('curl')) {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
  * @param string $data
572 572
  * @param string $contenttype
573 573
  *
574
- * @return object
574
+ * @return string
575 575
  */
576 576
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
577 577
     $c = new curl();
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
  * @param integer $instance
945 945
  * @param integer $voicebridge
946 946
  *
947
- * @return string
947
+ * @return boolean
948 948
  */
949 949
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
950 950
     global $DB;
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
  * @param string $meetingid
1293 1293
  * @param string $configxml
1294 1294
  *
1295
- * @return object
1295
+ * @return null|SimpleXMLElement
1296 1296
  */
1297 1297
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1298 1298
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url') . 'api/setConfigXML?';
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
  * @param array $recording
1347 1347
  * @param array $tools
1348 1348
  *
1349
- * @return array
1349
+ * @return null|stdClass
1350 1350
  */
1351 1351
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1352 1352
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
  *
1982 1982
  * @param array $bbbsession
1983 1983
  * @param array $recording
1984
- * @param object $rowdata
1984
+ * @param stdClass $rowdata
1985 1985
  *
1986 1986
  * @return object
1987 1987
  */
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
  *
2177 2177
  * @param array $bbbsession
2178 2178
  * @param array $recordings
2179
- * @param array $tools
2179
+ * @param string[] $tools
2180 2180
  *
2181 2181
  * @return array
2182 2182
  */
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2258 2258
  * in the getRecordings request considering only those that belong to deleted activities.
2259 2259
  *
2260
- * @param string $courseid
2260
+ * @param integer $courseid
2261 2261
  * @param string $bigbluebuttonbnid
2262 2262
  * @param bool   $subset
2263 2263
  *
@@ -2281,7 +2281,7 @@  discard block
 block discarded – undo
2281 2281
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2282 2282
  * in the getRecordings request considering only those that belong to imported recordings.
2283 2283
  *
2284
- * @param string $courseid
2284
+ * @param integer $courseid
2285 2285
  * @param string $bigbluebuttonbnid
2286 2286
  * @param bool   $subset
2287 2287
  *
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
 /**
2305 2305
  * Helper function to get recordings and imported recordings together.
2306 2306
  *
2307
- * @param string $courseid
2307
+ * @param integer $courseid
2308 2308
  * @param string $bigbluebuttonbnid
2309 2309
  * @param bool   $subset
2310 2310
  * @param bool   $includedeleted
@@ -2322,7 +2322,7 @@  discard block
 block discarded – undo
2322 2322
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2323 2323
  * in bigbluebuttonbn_logs.
2324 2324
  *
2325
- * @param string $courseid
2325
+ * @param integer $courseid
2326 2326
  * @param string $bigbluebuttonbnid
2327 2327
  * @param bool   $subset
2328 2328
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     }
190 190
     if ($xml) {
191 191
         // Either failure or success without meeting info.
192
-        return (array) $xml;
192
+        return (array)$xml;
193 193
     }
194 194
     // If the server is unreachable, then prompts the user of the necessary action.
195 195
     return array('returncode' => 'FAILED', 'message' => 'unreachable', 'messageKey' => 'Server is unreachable');
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                 foreach ($recordingxml->breakoutRooms->breakoutRoom as $breakoutroom) {
269 269
                     $url = \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url(
270 270
                         'getRecordings',
271
-                        ['recordID' => implode(',', (array) $breakoutroom)]
271
+                        ['recordID' => implode(',', (array)$breakoutroom)]
272 272
                     );
273 273
                     $xml = bigbluebuttonbn_wrap_xml_load_file($url);
274 274
                     if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         // Override imported flag with actual ID.
325 325
         $recording['imported'] = $recordimported->id;
326 326
         if (isset($recordimported->protected)) {
327
-            $recording['protected'] = (string) $recordimported->protected;
327
+            $recording['protected'] = (string)$recordimported->protected;
328 328
         }
329 329
         $recordsimportedarray[$recording['recordID']] = $recording;
330 330
     }
@@ -354,21 +354,21 @@  discard block
 block discarded – undo
354 354
     // Add formats.
355 355
     $playbackarray = array();
356 356
     foreach ($recording->playback->format as $format) {
357
-        $playbackarray[(string) $format->type] = array('type' => (string) $format->type,
358
-            'url' => trim((string) $format->url), 'length' => (string) $format->length);
357
+        $playbackarray[(string)$format->type] = array('type' => (string)$format->type,
358
+            'url' => trim((string)$format->url), 'length' => (string)$format->length);
359 359
         // Add preview per format when existing.
360 360
         if ($format->preview) {
361
-            $playbackarray[(string) $format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
361
+            $playbackarray[(string)$format->type]['preview'] = bigbluebuttonbn_get_recording_preview_images($format->preview);
362 362
         }
363 363
     }
364 364
     // Add the metadata to the recordings array.
365 365
     $metadataarray = bigbluebuttonbn_get_recording_array_meta(get_object_vars($recording->metadata));
366
-    $recordingarray = array('recordID' => (string) $recording->recordID,
367
-        'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name,
368
-        'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime,
369
-        'endTime' => (string) $recording->endTime, 'playbacks' => $playbackarray);
366
+    $recordingarray = array('recordID' => (string)$recording->recordID,
367
+        'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name,
368
+        'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime,
369
+        'endTime' => (string)$recording->endTime, 'playbacks' => $playbackarray);
370 370
     if (isset($recording->protected)) {
371
-        $recordingarray['protected'] = (string) $recording->protected;
371
+        $recordingarray['protected'] = (string)$recording->protected;
372 372
     }
373 373
     return $recordingarray + $metadataarray;
374 374
 }
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
 function bigbluebuttonbn_get_recording_preview_images($preview) {
384 384
     $imagesarray = array();
385 385
     foreach ($preview->images->image as $image) {
386
-        $imagearray = array('url' => trim((string) $image));
386
+        $imagearray = array('url' => trim((string)$image));
387 387
         foreach ($image->attributes() as $attkey => $attvalue) {
388
-            $imagearray[$attkey] = (string) $attvalue;
388
+            $imagearray[$attkey] = (string)$attvalue;
389 389
         }
390 390
         array_push($imagesarray, $imagearray);
391 391
     }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
     $ids = explode(',', $recordids);
481 481
     foreach ($ids as $id) {
482 482
         $xml = bigbluebuttonbn_wrap_xml_load_file(
483
-            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
483
+            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array)$params)
484 484
         );
485 485
         if ($xml && $xml->returncode != 'SUCCESS') {
486 486
             return false;
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
  * @return array $users
650 650
  */
651 651
 function bigbluebuttonbn_get_users(context $context = null) {
652
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
652
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
653 653
     foreach ($users as $key => $value) {
654 654
         $users[$key] = fullname($value);
655 655
     }
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
  * @return array $users
665 665
  */
666 666
 function bigbluebuttonbn_get_users_select(context $context = null) {
667
-    $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
667
+    $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
668 668
     foreach ($users as $key => $value) {
669 669
         $users[$key] = array('id' => $value->id, 'name' => fullname($value));
670 670
     }
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
  * @return array $roles
680 680
  */
681 681
 function bigbluebuttonbn_get_roles(context $context = null) {
682
-    $roles = (array) role_get_names($context);
682
+    $roles = (array)role_get_names($context);
683 683
     foreach ($roles as $key => $value) {
684 684
         $roles[$key] = $value->localname;
685 685
     }
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
  * @return array $users
695 695
  */
696 696
 function bigbluebuttonbn_get_roles_select(context $context = null) {
697
-    $roles = (array) role_get_names($context);
697
+    $roles = (array)role_get_names($context);
698 698
     foreach ($roles as $key => $value) {
699 699
         $roles[$key] = array('id' => $value->id, 'name' => $value->localname);
700 700
     }
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
  * @return object $role
710 710
  */
711 711
 function bigbluebuttonbn_get_role($id) {
712
-    $roles = (array) role_get_names();
712
+    $roles = (array)role_get_names();
713 713
     if (is_numeric($id) && isset($roles[$id])) {
714
-        return (object) $roles[$id];
714
+        return (object)$roles[$id];
715 715
     }
716 716
     foreach ($roles as $role) {
717 717
         if ($role->shortname == $id) {
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
             if (!empty($ownerid) && is_enrolled($context, $ownerid)) {
792 792
                 $participantlist[] = array(
793 793
                     'selectiontype' => 'user',
794
-                    'selectionid' => (string) $ownerid,
794
+                    'selectionid' => (string)$ownerid,
795 795
                     'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR);
796 796
             }
797 797
             continue;
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
     $now = time();
974 974
     if ($closingtime > 0 && $now < $closingtime) {
975 975
         $duration = ceil(($closingtime - $now) / 60);
976
-        $compensationtime = intval((int) \mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
976
+        $compensationtime = intval((int)\mod_bigbluebuttonbn\locallib\config::get('scheduled_duration_compensation'));
977 977
         $duration = intval($duration) + $compensationtime;
978 978
     }
979 979
     return $duration;
@@ -1175,16 +1175,16 @@  discard block
 block discarded – undo
1175 1175
  * @return array
1176 1176
  */
1177 1177
 function bigbluebuttonbn_get_meeting_info($meetingid, $updatecache = false) {
1178
-    $cachettl = (int) \mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1178
+    $cachettl = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_cache_ttl');
1179 1179
     $cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache');
1180 1180
     $result = $cache->get($meetingid);
1181 1181
     $now = time();
1182 1182
     if (!$updatecache && isset($result) && $now < ($result['creation_time'] + $cachettl)) {
1183 1183
         // Use the value in the cache.
1184
-        return (array) json_decode($result['meeting_info']);
1184
+        return (array)json_decode($result['meeting_info']);
1185 1185
     }
1186 1186
     // Ping again and refresh the cache.
1187
-    $meetinginfo = (array) bigbluebuttonbn_wrap_xml_load_file(
1187
+    $meetinginfo = (array)bigbluebuttonbn_wrap_xml_load_file(
1188 1188
         \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('getMeetingInfo', ['meetingID' => $meetingid])
1189 1189
     );
1190 1190
     $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meetinginfo)));
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
  */
1332 1332
 function bigbluebuttonbn_set_config_xml_array($meetingid, $configxml) {
1333 1333
     $configxml = bigbluebuttonbn_setConfigXML($meetingid, $configxml);
1334
-    $configxmlarray = (array) $configxml;
1334
+    $configxmlarray = (array)$configxml;
1335 1335
     if ($configxmlarray['returncode'] != 'SUCCESS') {
1336 1336
         debugging('BigBlueButton was not able to set the custom config.xml file', DEBUG_DEVELOPER);
1337 1337
         return '';
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
  * @return boolean
1387 1387
  */
1388 1388
 function bigbluebuttonbn_get_recording_data_row_editable($bbbsession) {
1389
-    return ($bbbsession['managerecordings'] && ((double) $bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1389
+    return ($bbbsession['managerecordings'] && ((double)$bbbsession['serverversion'] >= 1.0 || $bbbsession['bnserver']));
1390 1390
 }
1391 1391
 
1392 1392
 /**
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
  * @return boolean
1398 1398
  */
1399 1399
 function bigbluebuttonbn_get_recording_data_preview_enabled($bbbsession) {
1400
-    return ((double) $bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1400
+    return ((double)$bbbsession['serverversion'] >= 1.0 && $bbbsession['bigbluebuttonbn']->recordings_preview == '1');
1401 1401
 }
1402 1402
 
1403 1403
 /**
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
     }
1805 1805
     $id = 'recording-' . $target . '-' . $recording['recordID'];
1806 1806
     $onclick = 'M.mod_bigbluebuttonbn.recordings.recording' . ucfirst($data['action']) . '(this);';
1807
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1807
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recording_icons_enabled')) {
1808 1808
         // With icon for $manageaction.
1809 1809
         $iconattributes = array('id' => $id, 'class' => 'iconsmall');
1810 1810
         $linkattributes = array(
@@ -1948,7 +1948,7 @@  discard block
 block discarded – undo
1948 1948
         $groupmode = $DB->get_record_sql($sql, $params, IGNORE_MULTIPLE);
1949 1949
 
1950 1950
         $displayrow = true;
1951
-        if ((isset($groupmode->groupmode) && (int) $groupmode->groupmode != VISIBLEGROUPS)
1951
+        if ((isset($groupmode->groupmode) && (int)$groupmode->groupmode != VISIBLEGROUPS)
1952 1952
             && !$bbbsession['administrator'] && !$bbbsession['moderator']) {
1953 1953
             $groupid = explode('[', $recording['meetingID']);
1954 1954
             if (isset($groupid[1])) {
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
         // Enqueue it.
2099 2099
         \core\task\manager::queue_adhoc_task($task);
2100 2100
     } catch (Exception $e) {
2101
-        mtrace("Error while enqueuing completion_update_state task. " . (string) $e);
2101
+        mtrace("Error while enqueuing completion_update_state task. " . (string)$e);
2102 2102
     }
2103 2103
 }
2104 2104
 
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
  */
2636 2636
 function bigbluebuttonbn_settings_general(&$renderer) {
2637 2637
     // Configuration for BigBlueButton.
2638
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2638
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_general_shown()) {
2639 2639
         $renderer->render_group_header('general');
2640 2640
         $renderer->render_group_element(
2641 2641
             'server_url',
@@ -2657,7 +2657,7 @@  discard block
 block discarded – undo
2657 2657
  */
2658 2658
 function bigbluebuttonbn_settings_record(&$renderer) {
2659 2659
     // Configuration for 'recording' feature.
2660
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2660
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_record_meeting_shown()) {
2661 2661
         $renderer->render_group_header('recording');
2662 2662
         $renderer->render_group_element(
2663 2663
             'recording_default',
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
  */
2702 2702
 function bigbluebuttonbn_settings_importrecordings(&$renderer) {
2703 2703
     // Configuration for 'import recordings' feature.
2704
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2704
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_import_recordings_shown()) {
2705 2705
         $renderer->render_group_header('importrecordings');
2706 2706
         $renderer->render_group_element(
2707 2707
             'importrecordings_enabled',
@@ -2723,7 +2723,7 @@  discard block
 block discarded – undo
2723 2723
  */
2724 2724
 function bigbluebuttonbn_settings_showrecordings(&$renderer) {
2725 2725
     // Configuration for 'show recordings' feature.
2726
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2726
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_show_recordings_shown()) {
2727 2727
         $renderer->render_group_header('recordings');
2728 2728
         $renderer->render_group_element(
2729 2729
             'recordings_html_default',
@@ -2773,7 +2773,7 @@  discard block
 block discarded – undo
2773 2773
  */
2774 2774
 function bigbluebuttonbn_settings_waitmoderator(&$renderer) {
2775 2775
     // Configuration for wait for moderator feature.
2776
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2776
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_wait_moderator_shown()) {
2777 2777
         $renderer->render_group_header('waitformoderator');
2778 2778
         $renderer->render_group_element(
2779 2779
             'waitformoderator_default',
@@ -2803,7 +2803,7 @@  discard block
 block discarded – undo
2803 2803
  */
2804 2804
 function bigbluebuttonbn_settings_voicebridge(&$renderer) {
2805 2805
     // Configuration for "static voice bridge" feature.
2806
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2806
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_static_voice_bridge_shown()) {
2807 2807
         $renderer->render_group_header('voicebridge');
2808 2808
         $renderer->render_group_element(
2809 2809
             'voicebridge_editable',
@@ -2821,7 +2821,7 @@  discard block
 block discarded – undo
2821 2821
  */
2822 2822
 function bigbluebuttonbn_settings_preupload(&$renderer) {
2823 2823
     // Configuration for "preupload presentation" feature.
2824
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2824
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2825 2825
         // This feature only works if curl is installed.
2826 2826
         $preuploaddescripion = get_string('config_preuploadpresentation_description', 'bigbluebuttonbn');
2827 2827
         if (!extension_loaded('curl')) {
@@ -2849,7 +2849,7 @@  discard block
 block discarded – undo
2849 2849
  */
2850 2850
 function bigbluebuttonbn_settings_preupload_manage_default_file(&$renderer) {
2851 2851
     // Configuration for "preupload presentation" feature.
2852
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2852
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_preupload_presentation_shown()) {
2853 2853
         if (extension_loaded('curl')) {
2854 2854
             // This feature only works if curl is installed.
2855 2855
             $renderer->render_filemanager_default_file_presentation("presentation_default");
@@ -2866,7 +2866,7 @@  discard block
 block discarded – undo
2866 2866
  */
2867 2867
 function bigbluebuttonbn_settings_userlimit(&$renderer) {
2868 2868
     // Configuration for "user limit" feature.
2869
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2869
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_user_limit_shown()) {
2870 2870
         $renderer->render_group_header('userlimit');
2871 2871
         $renderer->render_group_element(
2872 2872
             'userlimit_default',
@@ -2888,7 +2888,7 @@  discard block
 block discarded – undo
2888 2888
  */
2889 2889
 function bigbluebuttonbn_settings_duration(&$renderer) {
2890 2890
     // Configuration for "scheduled duration" feature.
2891
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2891
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_scheduled_duration_shown()) {
2892 2892
         $renderer->render_group_header('scheduled');
2893 2893
         $renderer->render_group_element(
2894 2894
             'scheduled_duration_enabled',
@@ -2914,7 +2914,7 @@  discard block
 block discarded – undo
2914 2914
  */
2915 2915
 function bigbluebuttonbn_settings_participants(&$renderer) {
2916 2916
     // Configuration for defining the default role/user that will be moderator on new activities.
2917
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2917
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_moderator_default_shown()) {
2918 2918
         $renderer->render_group_header('participant');
2919 2919
         // UI for 'participants' feature.
2920 2920
         $roles = bigbluebuttonbn_get_roles();
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
  */
2940 2940
 function bigbluebuttonbn_settings_notifications(&$renderer) {
2941 2941
     // Configuration for "send notifications" feature.
2942
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2942
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_send_notifications_shown()) {
2943 2943
         $renderer->render_group_header('sendnotifications');
2944 2944
         $renderer->render_group_element(
2945 2945
             'sendnotifications_enabled',
@@ -2957,14 +2957,14 @@  discard block
 block discarded – undo
2957 2957
  */
2958 2958
 function bigbluebuttonbn_settings_clienttype(&$renderer) {
2959 2959
     // Configuration for "clienttype" feature.
2960
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2960
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_clienttype_shown()) {
2961 2961
         $renderer->render_group_header('clienttype');
2962 2962
         $renderer->render_group_element(
2963 2963
             'clienttype_editable',
2964 2964
             $renderer->render_group_element_checkbox('clienttype_editable', 0)
2965 2965
         );
2966 2966
         // Web Client default.
2967
-        $default = intval((int) \mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2967
+        $default = intval((int)\mod_bigbluebuttonbn\locallib\config::get('clienttype_default'));
2968 2968
         $choices = array(BIGBLUEBUTTON_CLIENTTYPE_FLASH => get_string('mod_form_block_clienttype_flash', 'bigbluebuttonbn'),
2969 2969
             BIGBLUEBUTTON_CLIENTTYPE_HTML5 => get_string('mod_form_block_clienttype_html5', 'bigbluebuttonbn'));
2970 2970
         $renderer->render_group_element(
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
  */
2988 2988
 function bigbluebuttonbn_settings_muteonstart(&$renderer) {
2989 2989
     // Configuration for BigBlueButton.
2990
-    if ((boolean) \mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
2990
+    if ((boolean)\mod_bigbluebuttonbn\settings\validator::section_muteonstart_shown()) {
2991 2991
         $renderer->render_group_header('muteonstart');
2992 2992
         $renderer->render_group_element(
2993 2993
             'muteonstart_default',
@@ -3009,7 +3009,7 @@  discard block
 block discarded – undo
3009 3009
  */
3010 3010
 function bigbluebuttonbn_settings_extended(&$renderer) {
3011 3011
     // Configuration for 'notify users when recording ready' feature.
3012
-    if (!(boolean) \mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3012
+    if (!(boolean)\mod_bigbluebuttonbn\settings\validator::section_settings_extended_shown()) {
3013 3013
         return;
3014 3014
     }
3015 3015
     $renderer->render_group_header('extended_capabilities');
@@ -3037,7 +3037,7 @@  discard block
 block discarded – undo
3037 3037
     global $DB;
3038 3038
     do {
3039 3039
         $encodedseed = sha1(bigbluebuttonbn_random_password(12));
3040
-        $meetingid = (string) $DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3040
+        $meetingid = (string)$DB->get_field('bigbluebuttonbn', 'meetingid', array('meetingid' => $encodedseed));
3041 3041
     } while ($meetingid == $encodedseed);
3042 3042
     return $encodedseed;
3043 3043
 }
@@ -3250,7 +3250,7 @@  discard block
 block discarded – undo
3250 3250
 function bigbluebuttonbn_instance_ownerid($bigbluebuttonbn) {
3251 3251
     global $DB;
3252 3252
     $filters = array('bigbluebuttonbnid' => $bigbluebuttonbn->id, 'log' => 'Add');
3253
-    $ownerid = (integer) $DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3253
+    $ownerid = (integer)$DB->get_field('bigbluebuttonbn_logs', 'userid', $filters);
3254 3254
     return $ownerid;
3255 3255
 }
3256 3256
 
@@ -3293,8 +3293,8 @@  discard block
 block discarded – undo
3293 3293
     $bbbsession['meetingname'] = $bbbsession['bigbluebuttonbn']->name;
3294 3294
     $bbbsession['meetingdescription'] = $bbbsession['bigbluebuttonbn']->intro;
3295 3295
     // Extra data for setting up the Meeting.
3296
-    $bbbsession['userlimit'] = intval((int) \mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3297
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3296
+    $bbbsession['userlimit'] = intval((int)\mod_bigbluebuttonbn\locallib\config::get('userlimit_default'));
3297
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('userlimit_editable')) {
3298 3298
         $bbbsession['userlimit'] = intval($bbbsession['bigbluebuttonbn']->userlimit);
3299 3299
     }
3300 3300
     $bbbsession['voicebridge'] = $bbbsession['bigbluebuttonbn']->voicebridge;
@@ -3444,7 +3444,7 @@  discard block
 block discarded – undo
3444 3444
         'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id.
3445 3445
     ];
3446 3446
     // Special metadata for recording processing.
3447
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3447
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) {
3448 3448
         $metadata["bn-recording-status"] = json_encode(
3449 3449
             array(
3450 3450
                 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'),
@@ -3452,10 +3452,10 @@  discard block
 block discarded – undo
3452 3452
             )
3453 3453
         );
3454 3454
     }
3455
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3455
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) {
3456 3456
         $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL'];
3457 3457
     }
3458
-    if ((boolean) \mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3458
+    if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('meetingevents_enabled')) {
3459 3459
         $metadata['analytics-callback-url'] = $bbbsession['meetingEventsURL'];
3460 3460
     }
3461 3461
     return $metadata;
Please login to merge, or discard this patch.
bbb_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
24 24
  */
25 25
 
26
-require(__DIR__.'/../../config.php');
27
-require_once(__DIR__.'/locallib.php');
28
-require_once(__DIR__.'/brokerlib.php');
26
+require(__DIR__ . '/../../config.php');
27
+require_once(__DIR__ . '/locallib.php');
28
+require_once(__DIR__ . '/brokerlib.php');
29 29
 
30 30
 global $PAGE, $USER, $CFG, $SESSION, $DB;
31 31
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 require_sesskey();
43 43
 
44 44
 if (empty($params['action'])) {
45
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
45
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
46 46
     return;
47 47
 }
48 48
 
49 49
 $error = bigbluebuttonbn_broker_validate_parameters($params);
50 50
 if (!empty($error)) {
51
-    header('HTTP/1.0 400 Bad Request. '.$error);
51
+    header('HTTP/1.0 400 Bad Request. ' . $error);
52 52
     return;
53 53
 }
54 54
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         echo $completionvalidate;
128 128
         return;
129 129
     }
130
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
130
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
131 131
 } catch (Exception $e) {
132
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
132
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
133 133
 }
Please login to merge, or discard this patch.