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 = 19-19 lines in 2 locations

application/traits/SortModels.php 1 location

@@ 20-38 (lines=19) @@
17
     * @return bool
18
     * @throws yii\db\Exception
19
     */
20
    public static function sortModels($ids, $field = 'sort_order')
21
    {
22
        $priorities = [];
23
        $start=0;
24
        $ids_sorted = $ids;
25
        sort($ids_sorted);
26
        foreach ($ids as $id) {
27
            $priorities[$id] = $ids_sorted[$start++];
28
        }
29
        $sql = "UPDATE "
30
            . static::tableName()
31
            . " SET $field = "
32
            . static::generateCase($priorities)
33
            . " WHERE id IN(" . implode(', ', $ids)
34
            . ")";
35
        return Yii::$app->db->createCommand(
36
            $sql
37
        )->execute() > 0;
38
    }
39
40
    public static function generateCase($priorities)
41
    {

application/modules/shop/controllers/BackendProductController.php 1 location

@@ 629-647 (lines=19) @@
626
     * @return bool
627
     * @throws \yii\db\Exception
628
     */
629
    public static function sortModels($tableName, $ids, $field = 'sort_order')
630
    {
631
        $priorities = [];
632
        $start = 0;
633
        $ids_sorted = $ids;
634
        sort($ids_sorted);
635
        foreach ($ids as $id) {
636
            $priorities[$id] = $ids_sorted[$start++];
637
        }
638
        $sql = "UPDATE " . $tableName . " SET $field = " . self::generateCase($priorities) . " WHERE id IN(" . implode(
639
                ', ',
640
                $ids
641
            ) . ")";
642
643
        return Yii::$app->db->createCommand(
644
            $sql
645
        )->execute() > 0;
646
647
    }
648
649
    /**
650
     * Рекурсивный генератор свойств для создания комплектаций.