| @@ 270-284 (lines=15) @@ | ||
| 267 | ||
| 268 | // Multiples |
|
| 269 | $is_multiple = mb_strpos($line, '*'); |
|
| 270 | if ($is_multiple !== false) : |
|
| 271 | $multiple = trim( substr($line, $is_multiple + 1) ); |
|
| 272 | ||
| 273 | // Errors |
|
| 274 | if ( !is_numeric($multiple) ) : |
|
| 275 | throw new CondorcetException(13, null); |
|
| 276 | endif; |
|
| 277 | ||
| 278 | $multiple = intval($multiple); |
|
| 279 | ||
| 280 | // Reformat line |
|
| 281 | $line = substr($line, 0, $is_multiple); |
|
| 282 | else : |
|
| 283 | $multiple = 1; |
|
| 284 | endif; |
|
| 285 | ||
| 286 | // Vote Weight |
|
| 287 | $is_voteWeight = mb_strpos($line, '^'); |
|
| @@ 288-302 (lines=15) @@ | ||
| 285 | ||
| 286 | // Vote Weight |
|
| 287 | $is_voteWeight = mb_strpos($line, '^'); |
|
| 288 | if ($is_voteWeight !== false) : |
|
| 289 | $weight = trim( substr($line, $is_voteWeight + 1) ); |
|
| 290 | ||
| 291 | // Errors |
|
| 292 | if ( !is_numeric($weight) ) : |
|
| 293 | throw new CondorcetException(13, null); |
|
| 294 | endif; |
|
| 295 | ||
| 296 | $weight = intval($weight); |
|
| 297 | ||
| 298 | // Reformat line |
|
| 299 | $line = substr($line, 0, $is_voteWeight); |
|
| 300 | else : |
|
| 301 | $weight = 1; |
|
| 302 | endif; |
|
| 303 | ||
| 304 | // Tags + vote |
|
| 305 | if (mb_strpos($line, '||') !== false) : |
|