GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 25-25 lines in 2 locations

symphony/lib/toolkit/fields/field.select.php 1 location

@@ 520-544 (lines=25) @@
517
        Grouping:
518
    -------------------------------------------------------------------------*/
519
520
    public function groupRecords($records)
521
    {
522
        if (!is_array($records) || empty($records)) {
523
            return;
524
        }
525
526
        $groups = array($this->get('element_name') => array());
527
528
        foreach ($records as $r) {
529
            $data = $r->getData($this->get('id'));
530
            $value = General::sanitize($data['value']);
531
532
            if (!isset($groups[$this->get('element_name')][$data['handle']])) {
533
                $groups[$this->get('element_name')][$data['handle']] = array(
534
                    'attr' => array('handle' => $data['handle'], 'value' => $value),
535
                    'records' => array(),
536
                    'groups' => array()
537
                );
538
            }
539
540
            $groups[$this->get('element_name')][$data['handle']]['records'][] = $r;
541
        }
542
543
        return $groups;
544
    }
545
546
    /*-------------------------------------------------------------------------
547
        Events:

symphony/lib/toolkit/fields/field.input.php 1 location

@@ 369-393 (lines=25) @@
366
        Grouping:
367
    -------------------------------------------------------------------------*/
368
369
    public function groupRecords($records)
370
    {
371
        if (!is_array($records) || empty($records)) {
372
            return;
373
        }
374
375
        $groups = array($this->get('element_name') => array());
376
377
        foreach ($records as $r) {
378
            $data = $r->getData($this->get('id'));
379
            $value = General::sanitize($data['value']);
380
381
            if (!isset($groups[$this->get('element_name')][$data['handle']])) {
382
                $groups[$this->get('element_name')][$data['handle']] = array(
383
                    'attr' => array('handle' => $data['handle'], 'value' => $value),
384
                    'records' => array(),
385
                    'groups' => array()
386
                );
387
            }
388
389
            $groups[$this->get('element_name')][$data['handle']]['records'][] = $r;
390
        }
391
392
        return $groups;
393
    }
394
}
395