Code Duplication    Length = 10-10 lines in 2 locations

src/eXpansion/Bundle/WidgetBestCheckpoints/Plugins/BestCheckpoints.php 2 locations

@@ 139-148 (lines=10) @@
136
     * @param int      $position
137
     * @param int      $oldPosition
138
     */
139
    public function onLocalRecordsBetterPosition(Record $record, Record $oldRecord, $records, $position, $oldPosition, BaseRecords $baseRecords)
140
    {
141
        if (!$this->checkRecordPlugin($baseRecords)) {
142
            return;
143
        }
144
145
        if ($position == 1) {
146
            $this->updater->setLocalRecord($record->getCheckpoints());
147
        }
148
    }
149
150
    /**
151
     * Called when a player finishes map with better time but keeps same position.
@@ 158-167 (lines=10) @@
155
     * @param Record[] $records
156
     * @param          $position
157
     */
158
    public function onLocalRecordsSamePosition(Record $record, Record $oldRecord, $records, $position, BaseRecords $baseRecords)
159
    {
160
        if (!$this->checkRecordPlugin($baseRecords)) {
161
            return;
162
        }
163
164
        if ($position == 1) {
165
            $this->updater->setLocalRecord($record->getCheckpoints());
166
        }
167
    }
168
169
    /**
170
     * Check if we can use the data for this plugin.