Code Duplication    Length = 15-15 lines in 2 locations

lib/ElectionProcess/VotesProcess.php 2 locations

@@ 255-269 (lines=15) @@
252
253
            // Multiples
254
            $is_multiple = mb_strpos($line, '*');
255
            if ($is_multiple !== false) :
256
                $multiple = trim( substr($line, $is_multiple + 1) );
257
258
                // Errors
259
                if ( !is_numeric($multiple) ) :
260
                    throw new CondorcetException(13, null);
261
                endif;
262
263
                $multiple = intval($multiple);
264
265
                // Reformat line
266
                $line = substr($line, 0, $is_multiple);
267
            else :
268
                $multiple = 1;
269
            endif;
270
271
            // Vote Weight
272
            $is_voteWeight = mb_strpos($line, '^');
@@ 273-287 (lines=15) @@
270
271
            // Vote Weight
272
            $is_voteWeight = mb_strpos($line, '^');
273
            if ($is_voteWeight !== false) :
274
                $weight = trim( substr($line, $is_voteWeight + 1) );
275
276
                // Errors
277
                if ( !is_numeric($weight) ) :
278
                    throw new CondorcetException(13, null);
279
                endif;
280
281
                $weight = intval($weight);
282
283
                // Reformat line
284
                $line = substr($line, 0, $is_voteWeight);
285
            else :
286
                $weight = 1;
287
            endif;
288
289
            // Tags + vote
290
            if (mb_strpos($line, '||') !== false) :