-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on getdkan/contracts (#20)
- Loading branch information
Showing
3 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace CsvParser\Parser; | ||
|
||
/** | ||
* Interface for parsing CSV files. | ||
*/ | ||
interface ParserInterface | ||
{ | ||
|
||
/** | ||
* Feed a string into the parser. | ||
* | ||
* @param string $chunk | ||
* A chunk of the CSV being fed into the parser. | ||
*/ | ||
public function feed(string $chunk): void; | ||
|
||
/** | ||
* Get a record. | ||
* | ||
* @return array|null | ||
* The record as an array, or null. | ||
*/ | ||
public function getRecord(); | ||
|
||
/** | ||
* Reset the parser to an initialized state. | ||
*/ | ||
public function reset(): void; | ||
|
||
/** | ||
* At the end of a run of parsing, ensure there were no errors. | ||
* | ||
* @throws \Exception | ||
* Throws an exception if the state machine was out of sync with our | ||
* expectations. | ||
*/ | ||
public function finish(): void; | ||
} |