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