Code Duplication    Length = 3-3 lines in 2 locations

core/UserAPI.php 2 locations

@@ 331-333 (lines=3) @@
328
    public function JSON_listIdentityProviders($country) {
329
        $idps = $this->listAllIdentityProviders(1, $country);
330
        $returnArray = [];
331
        foreach ($idps as $idp) {
332
            $returnArray[] = ['idp' => $idp['entityID'], 'display' => $idp['title']];
333
        }
334
        echo $this->return_json($returnArray);
335
    }
336
@@ 362-364 (lines=3) @@
359
    public function JSON_orderIdentityProviders($country, $location = NULL) {
360
        $idps = $this->orderIdentityProviders($country, $location);
361
        $returnArray = [];
362
        foreach ($idps as $idp) {
363
            $returnArray[] = ['idp' => $idp['id'], 'display' => $idp['title']];
364
        }
365
        echo $this->return_json($returnArray);
366
    }
367