Code Duplication    Length = 15-15 lines in 2 locations

lib/ElectionProcess/VotesProcess.php 2 locations

@@ 237-251 (lines=15) @@
234
235
            // Multiples
236
            $is_multiple = mb_strpos($line, '*');
237
            if ($is_multiple !== false) :
238
                $multiple = trim( substr($line, $is_multiple + 1) );
239
240
                // Errors
241
                if ( !is_numeric($multiple) ) :
242
                    throw new CondorcetException(13, null);
243
                endif;
244
245
                $multiple = intval($multiple);
246
247
                // Reformat line
248
                $line = substr($line, 0, $is_multiple);
249
            else :
250
                $multiple = 1;
251
            endif;
252
253
            // Vote Weight
254
            $is_voteWeight = mb_strpos($line, '^');
@@ 255-269 (lines=15) @@
252
253
            // Vote Weight
254
            $is_voteWeight = mb_strpos($line, '^');
255
            if ($is_voteWeight !== false) :
256
                $weight = trim( substr($line, $is_voteWeight + 1) );
257
258
                // Errors
259
                if ( !is_numeric($weight) ) :
260
                    throw new CondorcetException(13, null);
261
                endif;
262
263
                $weight = intval($weight);
264
265
                // Reformat line
266
                $line = substr($line, 0, $is_voteWeight);
267
            else :
268
                $weight = 1;
269
            endif;
270
271
            // Tags + vote
272
            if (mb_strpos($line, '||') !== false) :