1
0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__serveur-vote-lalis/include/condorcet/Documentation/Election Class/public Election--parseVotesWithoutFail.md
2022-09-21 14:01:45 +02:00

1.5 KiB

public Election::parseVotesWithoutFail

Description

public Election->parseVotesWithoutFail ( SplFileInfo|string $input [, bool $isFile = false , ?Closure $callBack = null] ): int

Similar to parseVote method. But will ignore invalid line. This method is also far less greedy in memory and must be prefered for very large file input. And to combine with the use of an external data handler.

input: SplFileInfo|string

String, valid path to a text file or an object SplFileInfo or extending it like SplFileObject.

isFile: bool

If true, the string input is evalatued as path to text file.

callBack: ?Closure

Callback function to execute after each registered vote.

Return value:

(int) Number of invalid records into input (except empty lines). It's not an invalid votes count. Check Election::countVotes if you want to be sure.



Examples and explanation