Code Duplication    Length = 3-4 lines in 3 locations

locallib.php 3 locations

@@ 166-169 (lines=4) @@
163
        }
164
        return $meetings;
165
    }
166
    if ($xml) {
167
        // Either failure or success without meetings.
168
        return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
169
    }
170
    // If the server is unreachable, then prompts the user of the necessary action.
171
    return null;
172
}
@@ 198-201 (lines=4) @@
195
                     'metadata' => $xml->metadata,
196
                   );
197
    }
198
    if ($xml) {
199
        // Either failure or success without meeting info.
200
        return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
201
    }
202
    // If the server is unreachable, then prompts the user of the necessary action.
203
    return null;
204
}
@@ 431-433 (lines=3) @@
428
    $xml = bigbluebuttonbn_wrap_xml_load_file(
429
        \mod_bigbluebuttonbn\locallib\bigbluebutton::action_url('end', ['meetingID' => $meetingid, 'password' => $modpw])
430
      );
431
    if ($xml) {
432
        // If the xml packet returned failure it displays the message to the user.
433
        return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey);
434
    }
435
    // If the server is unreachable, then prompts the user of the necessary action.
436
    return null;