Code Duplication    Length = 12-12 lines in 3 locations

locallib.php 3 locations

@@ 456-467 (lines=12) @@
453
 *
454
 * @return boolean
455
 */
456
function bigbluebuttonbn_delete_recordings($recordids) {
457
    $ids = explode(',', $recordids);
458
    foreach ($ids as $id) {
459
        $xml = bigbluebuttonbn_wrap_xml_load_file(
460
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('deleteRecordings', ['recordID' => $id])
461
        );
462
        if ($xml && $xml->returncode != 'SUCCESS') {
463
            return false;
464
        }
465
    }
466
    return true;
467
}
468
469
/**
470
 * Perform publishRecordings on BBB.
@@ 475-486 (lines=12) @@
472
 * @param string $recordids
473
 * @param string $publish
474
 */
475
function bigbluebuttonbn_publish_recordings($recordids, $publish = 'true') {
476
    $ids = explode(',', $recordids);
477
    foreach ($ids as $id) {
478
        $xml = bigbluebuttonbn_wrap_xml_load_file(
479
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('publishRecordings', ['recordID' => $id, 'publish' => $publish])
480
        );
481
        if ($xml && $xml->returncode != 'SUCCESS') {
482
            return false;
483
        }
484
    }
485
    return true;
486
}
487
488
/**
489
 * Perform updateRecordings on BBB.
@@ 494-505 (lines=12) @@
491
 * @param string $recordids
492
 * @param array $params ['key'=>param_key, 'value']
493
 */
494
function bigbluebuttonbn_update_recordings($recordids, $params) {
495
    $ids = explode(',', $recordids);
496
    foreach ($ids as $id) {
497
        $xml = bigbluebuttonbn_wrap_xml_load_file(
498
            \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('updateRecordings', ['recordID' => $id] + (array) $params)
499
        );
500
        if ($xml && $xml->returncode != 'SUCCESS') {
501
            return false;
502
        }
503
    }
504
    return true;
505
}
506
507
/**
508
 * Perform end on BBB.