Skip to content

Commit

Permalink
fix CSV camelCase prop
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jul 5, 2022
1 parent 88f93e5 commit b2ec526
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Persistence/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,18 @@ class Csv extends Persistence

/**
* Mode of operation. 'r' for reading and 'w' for writing.
* If you manually set this operation, it will be used
* for file opening.
* If you manually set this operation, it will be used for file opening.
*
* @var string
*/
public $mode;

/** @var string Delimiter in CSV file. */
public $delimiter = ',';

/** @var string Enclosure in CSV file. */
public $enclosure = '"';

/** @var string Escape character in CSV file. */
public $escape_char = '\\';
public $escapeChar = '\\';

/** @var array|null Array of field names. */
public $header;
Expand Down Expand Up @@ -105,7 +102,7 @@ public function closeFile(): void
*/
public function getLine(): ?array
{
$data = fgetcsv($this->handle, 0, $this->delimiter, $this->enclosure, $this->escape_char);
$data = fgetcsv($this->handle, 0, $this->delimiter, $this->enclosure, $this->escapeChar);
if ($data === false) {
return null;
}
Expand All @@ -120,7 +117,7 @@ public function getLine(): ?array
*/
public function putLine(array $data): void
{
$ok = fputcsv($this->handle, $data, $this->delimiter, $this->enclosure, $this->escape_char);
$ok = fputcsv($this->handle, $data, $this->delimiter, $this->enclosure, $this->escapeChar);
if ($ok === false) {
throw new Exception('Cannot write to CSV file');
}
Expand Down

0 comments on commit b2ec526

Please sign in to comment.