Code Duplication    Length = 4-4 lines in 3 locations

brokerlib.php 3 locations

@@ 183-186 (lines=4) @@
180
    $recordings = bigbluebuttonbn_get_allrecordings($courseid, $bigbluebuttonbnid, $showroom, $includedeleted);
181
    if (array_key_exists($params['id'], $recordings)) {
182
        // Look up for an update on the imported recording.
183
        if (!array_key_exists('messageKey', $recordings[$params['id']])) {
184
            // The recording was found.
185
            $callbackresponse = bigbluebuttonbn_broker_recording_info_current($recordings[$params['id']], $params);
186
        }
187
        $callbackresponsedata = json_encode($callbackresponse);
188
        return "{$params['callback']}({$callbackresponsedata});";
189
    }
@@ 192-195 (lines=4) @@
189
    }
190
    // As the recordingid was not identified as imported recording link, look up for a real recording.
191
    $recordings = bigbluebuttonbn_get_recordings_array($params['idx'], $params['id']);
192
    if (array_key_exists($params['id'], $recordings)) {
193
        // The recording was found.
194
        $callbackresponse = bigbluebuttonbn_broker_recording_info_current($recordings[$params['id']], $params);
195
    }
196
    $callbackresponsedata = json_encode($callbackresponse);
197
    return "{$params['callback']}({$callbackresponsedata});";
198
}
@@ 235-238 (lines=4) @@
232
function bigbluebuttonbn_broker_recording_play($params) {
233
    $callbackresponse = array('status' => true, 'found' => false);
234
    $recordings = bigbluebuttonbn_get_recordings_array($params['idx'], $params['id']);
235
    if (array_key_exists($params['id'], $recordings)) {
236
        // The recording was found.
237
        $callbackresponse = bigbluebuttonbn_broker_recording_info_current($recordings[$params['id']], $params);
238
    }
239
    $callbackresponsedata = json_encode($callbackresponse);
240
    return "{$params['callback']}({$callbackresponsedata});";
241
}