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

@@ 658-676 (lines=19) @@
655
     * @return bool
656
     * @throws \yii\db\Exception
657
     */
658
    public static function sortModels($tableName, $ids, $field = 'sort_order')
659
    {
660
        $priorities = [];
661
        $start = 0;
662
        $ids_sorted = $ids;
663
        sort($ids_sorted);
664
        foreach ($ids as $id) {
665
            $priorities[$id] = $ids_sorted[$start++];
666
        }
667
        $sql = "UPDATE " . $tableName . " SET $field = " . self::generateCase($priorities) . " WHERE id IN(" . implode(
668
                ', ',
669
                $ids
670
            ) . ")";
671
672
        return Yii::$app->db->createCommand(
673
            $sql
674
        )->execute() > 0;
675
676
    }
677
678
    /**
679
     * Рекурсивный генератор свойств для создания комплектаций.