Completed
Pull Request — master (#134)
by Jesus
02:04
created
locallib.php 1 patch
Doc Comments   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
  * Helper function to retrieve imported recordings from the Moodle database.
297 297
  * The references are stored as events in bigbluebuttonbn_logs.
298 298
  *
299
- * @param string $courseid
299
+ * @param integer $courseid
300 300
  * @param string $bigbluebuttonbnid
301 301
  * @param bool   $subset
302 302
  *
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 /**
325 325
  * Helper function to retrive the default config.xml file.
326 326
  *
327
- * @return string
327
+ * @return null|SimpleXMLElement
328 328
  */
329 329
 function bigbluebuttonbn_get_default_config_xml() {
330 330
     $xml = bigbluebuttonbn_wrap_xml_load_file(
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
  * @param object $a
407 407
  * @param object $b
408 408
  *
409
- * @return array
409
+ * @return integer
410 410
  */
411 411
 function bigbluebuttonbn_recording_build_sorter($a, $b) {
412 412
     global $CFG;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
  * @param string $data
521 521
  * @param string $contenttype
522 522
  *
523
- * @return object
523
+ * @return null|SimpleXMLElement
524 524
  */
525 525
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
526 526
     if (extension_loaded('curl')) {
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
  * @param string $data
562 562
  * @param string $contenttype
563 563
  *
564
- * @return object
564
+ * @return string
565 565
  */
566 566
 function bigbluebuttonbn_wrap_xml_load_file_curl_request($url, $method = 'GET', $data = null, $contenttype = 'text/xml') {
567 567
     $c = new curl();
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
  * @param integer $instance
935 935
  * @param integer $voicebridge
936 936
  *
937
- * @return string
937
+ * @return boolean
938 938
  */
939 939
 function bigbluebuttonbn_voicebridge_unique($instance, $voicebridge) {
940 940
     global $DB;
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
  * @param string $meetingid
1258 1258
  * @param string $configxml
1259 1259
  *
1260
- * @return object
1260
+ * @return null|SimpleXMLElement
1261 1261
  */
1262 1262
 function bigbluebuttonbn_set_config_xml($meetingid, $configxml) {
1263 1263
     $urldefaultconfig = \mod_bigbluebuttonbn\locallib\config::get('server_url').'api/setConfigXML?';
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
  * @param array $recording
1307 1307
  * @param array $tools
1308 1308
  *
1309
- * @return array
1309
+ * @return null|stdClass
1310 1310
  */
1311 1311
 function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ['protect', 'publish', 'delete']) {
1312 1312
     if (!bigbluebuttonbn_include_recording_table_row($bbbsession, $recording)) {
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
  *
1934 1934
  * @param array $bbbsession
1935 1935
  * @param array $recording
1936
- * @param object $rowdata
1936
+ * @param stdClass $rowdata
1937 1937
  *
1938 1938
  * @return object
1939 1939
  */
@@ -2051,7 +2051,7 @@  discard block
 block discarded – undo
2051 2051
  *
2052 2052
  * @param array $bbbsession
2053 2053
  * @param array $recordings
2054
- * @param array $tools
2054
+ * @param string[] $tools
2055 2055
  *
2056 2056
  * @return array
2057 2057
  */
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2130 2130
  * in the getRecordings request considering only those that belong to deleted activities.
2131 2131
  *
2132
- * @param string $courseid
2132
+ * @param integer $courseid
2133 2133
  * @param string $bigbluebuttonbnid
2134 2134
  * @param bool   $subset
2135 2135
  *
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
  * Helper function to define the sql used for gattering the bigbluebuttonbnids whose meetingids should be included
2154 2154
  * in the getRecordings request considering only those that belong to imported recordings.
2155 2155
  *
2156
- * @param string $courseid
2156
+ * @param integer $courseid
2157 2157
  * @param string $bigbluebuttonbnid
2158 2158
  * @param bool   $subset
2159 2159
  *
@@ -2176,7 +2176,7 @@  discard block
 block discarded – undo
2176 2176
 /**
2177 2177
  * Helper function to get recordings and imported recordings together.
2178 2178
  *
2179
- * @param string $courseid
2179
+ * @param integer $courseid
2180 2180
  * @param string $bigbluebuttonbnid
2181 2181
  * @param bool   $subset
2182 2182
  * @param bool   $includedeleted
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
  * Helper function to retrieve recordings from the BigBlueButton. The references are stored as events
2195 2195
  * in bigbluebuttonbn_logs.
2196 2196
  *
2197
- * @param string $courseid
2197
+ * @param integer $courseid
2198 2198
  * @param string $bigbluebuttonbnid
2199 2199
  * @param bool   $subset
2200 2200
  * @param bool   $includedeleted
Please login to merge, or discard this patch.
lib.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -28,23 +28,23 @@  discard block
 block discarded – undo
28 28
 
29 29
 global $CFG;
30 30
 
31
-require_once($CFG->dirroot.'/calendar/lib.php');
32
-require_once($CFG->dirroot.'/message/lib.php');
33
-require_once($CFG->dirroot.'/mod/lti/OAuth.php');
34
-require_once($CFG->dirroot.'/tag/lib.php');
35
-require_once($CFG->libdir.'/accesslib.php');
36
-require_once($CFG->libdir.'/completionlib.php');
37
-require_once($CFG->libdir.'/datalib.php');
38
-require_once($CFG->libdir.'/enrollib.php');
39
-require_once($CFG->libdir.'/filelib.php');
40
-require_once($CFG->libdir.'/formslib.php');
31
+require_once($CFG->dirroot . '/calendar/lib.php');
32
+require_once($CFG->dirroot . '/message/lib.php');
33
+require_once($CFG->dirroot . '/mod/lti/OAuth.php');
34
+require_once($CFG->dirroot . '/tag/lib.php');
35
+require_once($CFG->libdir . '/accesslib.php');
36
+require_once($CFG->libdir . '/completionlib.php');
37
+require_once($CFG->libdir . '/datalib.php');
38
+require_once($CFG->libdir . '/enrollib.php');
39
+require_once($CFG->libdir . '/filelib.php');
40
+require_once($CFG->libdir . '/formslib.php');
41 41
 
42 42
 // JWT is included in Moodle 3.7 core, but a local package is still needed for backward compatibility.
43 43
 if (!class_exists('\Firebase\JWT\JWT')) {
44 44
     if (file_exists($CFG->libdir . '/php-jwt/src/JWT.php')) {
45 45
         require_once($CFG->libdir . '/php-jwt/src/JWT.php');
46 46
     } else {
47
-        require_once($CFG->dirroot.'/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
47
+        require_once($CFG->dirroot . '/mod/bigbluebuttonbn/vendor/firebase/php-jwt/src/JWT.php');
48 48
     }
49 49
 }
50 50
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     $CFG->bigbluebuttonbn = array();
53 53
 }
54 54
 
55
-if (file_exists(dirname(__FILE__).'/config.php')) {
56
-    require_once(dirname(__FILE__).'/config.php');
55
+if (file_exists(dirname(__FILE__) . '/config.php')) {
56
+    require_once(dirname(__FILE__) . '/config.php');
57 57
 }
58 58
 
59 59
 /*
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
         return null;
107 107
     }
108 108
     $features = array(
109
-        (string) FEATURE_IDNUMBER => true,
110
-        (string) FEATURE_GROUPS => true,
111
-        (string) FEATURE_GROUPINGS => true,
112
-        (string) FEATURE_GROUPMEMBERSONLY => true,
113
-        (string) FEATURE_MOD_INTRO => true,
114
-        (string) FEATURE_BACKUP_MOODLE2 => true,
115
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
116
-        (string) FEATURE_GRADE_HAS_GRADE => false,
117
-        (string) FEATURE_GRADE_OUTCOMES => false,
118
-        (string) FEATURE_SHOW_DESCRIPTION => true,
109
+        (string)FEATURE_IDNUMBER => true,
110
+        (string)FEATURE_GROUPS => true,
111
+        (string)FEATURE_GROUPINGS => true,
112
+        (string)FEATURE_GROUPMEMBERSONLY => true,
113
+        (string)FEATURE_MOD_INTRO => true,
114
+        (string)FEATURE_BACKUP_MOODLE2 => true,
115
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
116
+        (string)FEATURE_GRADE_HAS_GRADE => false,
117
+        (string)FEATURE_GRADE_OUTCOMES => false,
118
+        (string)FEATURE_SHOW_DESCRIPTION => true,
119 119
     );
120
-    if (isset($features[(string) $feature])) {
120
+    if (isset($features[(string)$feature])) {
121 121
         return $features[$feature];
122 122
     }
123 123
     return null;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn) {
217 217
     global $DB;
218 218
     $sql  = "SELECT * FROM {bigbluebuttonbn_logs} ";
219
-    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
219
+    $sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND " . $DB->sql_compare_text('meta') . " = ?";
220 220
     $logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
221 221
     $meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
222 222
     bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn) {
240 240
     global $DB;
241 241
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
242
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ), '*');
242
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',), '*');
243 243
     if ($completed > 0) {
244
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.
245
-            get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.
244
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' .
245
+            get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' .
246 246
             get_string('view_message_times', 'bigbluebuttonbn');
247 247
     }
248 248
     return '';
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 function bigbluebuttonbn_user_complete($course, $user, $mod, $bigbluebuttonbn) {
263 263
     global $DB;
264 264
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
265
-        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join', ),
265
+        'bigbluebuttonbnid' => $bigbluebuttonbn->id, 'userid' => $user->id, 'log' => 'Join',),
266 266
         '*', IGNORE_MULTIPLE);
267 267
     return $completed > 0;
268 268
 }
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
  * @return array status array
424 424
  */
425 425
 function bigbluebuttonbn_reset_recordings($courseid) {
426
-    require_once(__DIR__.'/locallib.php');
426
+    require_once(__DIR__ . '/locallib.php');
427 427
     // Criteria for search [courseid | bigbluebuttonbn=null | subset=false | includedeleted=true].
428 428
     $recordings = bigbluebuttonbn_get_recordings($courseid, null, false, true);
429 429
     // Remove all the recordings.
@@ -491,16 +491,16 @@  discard block
 block discarded – undo
491 491
     if ($bigbluebuttonbn->visible) {
492 492
         $classes = 'class="dimmed" ';
493 493
     }
494
-    $str  = '<div class="bigbluebuttonbn overview">'."\n";
495
-    $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
496
-    $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
497
-      '">'.$bigbluebuttonbn->name.'</a>'."\n";
498
-    $str .= '  </div>'."\n";
499
-    $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).
500
-        '</div>'."\n";
501
-    $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
502
-      .'</div>'."\n";
503
-    $str .= '</div>'."\n";
494
+    $str  = '<div class="bigbluebuttonbn overview">' . "\n";
495
+    $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
496
+    $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
497
+      '">' . $bigbluebuttonbn->name . '</a>' . "\n";
498
+    $str .= '  </div>' . "\n";
499
+    $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) .
500
+        '</div>' . "\n";
501
+    $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
502
+      .'</div>' . "\n";
503
+    $str .= '</div>' . "\n";
504 504
     return $str;
505 505
 }
506 506
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
     if (count($files) == 1) {
733 733
         // Get the first (and only) file.
734 734
         $file = reset($files);
735
-        $filesrc = '/'.$file->get_filename();
735
+        $filesrc = '/' . $file->get_filename();
736 736
     }
737 737
     return $filesrc;
738 738
 }
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
     if (!$filename) {
802 802
         return false;
803 803
     }
804
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
804
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
805 805
     $fs = get_file_storage();
806 806
     $file = $fs->get_file_by_hash(sha1($fullpath));
807 807
     if (!$file || $file->is_directory()) {
Please login to merge, or discard this patch.