Code Duplication    Length = 19-20 lines in 2 locations

src/eXpansion/Bundle/Maps/Plugins/Gui/MapsWindowFactory.php 1 location

@@ 99-118 (lines=20) @@
96
        $this->jukeboxPlugin->add($login, $args['wish']->uId);
97
    }
98
99
    public function setMaps($maps)
100
    {
101
        $this->genericData = [];
102
103
        /**
104
         * @var string $i
105
         * @var Map $map
106
         */
107
        $i = 1;
108
        foreach ($maps as $uid => $map) {
109
            $this->genericData[] = [
110
                'index' => $i++,
111
                'name' => TMString::trimControls($map->name),
112
                'author' => $map->author,
113
                'time' => $this->timeFormatter->timeToText($map->goldTime, true),
114
                'wish' => $map
115
            ];
116
        }
117
118
    }
119
120
    /**
121
     * @param ManialinkInterface $manialink

src_experimantal/eXpansionExperimantal/Bundle/Dedimania/Plugins/Gui/DedirecsWindow.php 1 location

@@ 68-86 (lines=19) @@
65
    /**
66
     * @param DedimaniaRecord[] $records
67
     */
68
    public function setRecords($records)
69
    {
70
        $this->genericData = [];
71
72
        /**
73
         * @var string          $i
74
         * @var DedimaniaRecord $record
75
         */
76
        $i = 1;
77
        foreach ($records as $uid => $record) {
78
            $this->genericData[] = [
79
                'index' => $i++,
80
                'time' => $this->timeFormatter->timeToText($record->best, true),
81
                'name' => TMString::trimControls($record->nickName),
82
                'login' => $record->login,
83
            ];
84
        }
85
86
    }
87
88
    /**
89
     * @param ManialinkInterface $manialink