Code Duplication    Length = 3-3 lines in 2 locations

core/UserAPI.php 2 locations

@@ 337-339 (lines=3) @@
334
    public function JSON_listIdentityProviders($country) {
335
        $idps = $this->listAllIdentityProviders(1, $country);
336
        $returnArray = [];
337
        foreach ($idps as $idp) {
338
            $returnArray[] = ['idp' => $idp['entityID'], 'display' => $idp['title']];
339
        }
340
        echo $this->return_json($returnArray);
341
    }
342
@@ 368-370 (lines=3) @@
365
    public function JSON_orderIdentityProviders($country, $location = NULL) {
366
        $idps = $this->orderIdentityProviders($country, $location);
367
        $returnArray = [];
368
        foreach ($idps as $idp) {
369
            $returnArray[] = ['idp' => $idp['id'], 'display' => $idp['title']];
370
        }
371
        echo $this->return_json($returnArray);
372
    }
373