Skip to content

Commit

Permalink
Add parameter to allow user to set text enclosure
Browse files Browse the repository at this point in the history
Fixes issue Soapbox#50
  • Loading branch information
AaronHolbrook authored Jul 12, 2019
1 parent af93de2 commit 8f4509d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Parsers/CsvParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ class CsvParser extends Parser
{
private $csv;

public function __construct($data, $delimiter = null)
public function __construct($data, $delimiter = null, $enclosure = '|')
{
if (is_string($data)) {
$this->csv = Reader::createFromString($data);
if ($delimiter) {
$this->csv->setDelimiter($delimiter);
}
$this->csv->setEnclosure('|');
$this->csv->setEnclosure($enclosure);
} else {
throw new InvalidArgumentException(
'CsvParser only accepts (string) [csv] for $data.'
Expand Down

0 comments on commit 8f4509d

Please sign in to comment.