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