Skip to content

Commit

Permalink
bug fix Writer applying CSV controls #244
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Aug 21, 2017
1 parent 60ea563 commit 5dc305e
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 18 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

All Notable changes to `Csv` will be documented in this file

## 9.0.1 - 2017-08-21

### Added

- Nothing

### Deprecated

- Nothing

### Fixed

- CSV controls not applied when calling Writer::insertOne

### Removed

- Nothing

## 9.0.0 - 2017-08-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/ByteSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/CannotInsertRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/CharsetConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/ColumnConsistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/HTMLConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/MapIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/RFC4180Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
4 changes: 2 additions & 2 deletions src/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -125,7 +125,7 @@ public function insertOne(array $record): int
{
$record = array_reduce($this->formatters, [$this, 'formatRecord'], $record);
$this->validateRecord($record);
$bytes = $this->document->fputcsv($record, ...$this->document->getCsvControl());
$bytes = $this->document->fputcsv($record, $this->delimiter, $this->enclosure, $this->escape);
if (!$bytes) {
throw CannotInsertRecord::triggerOnInsertion($record);
}
Expand Down
2 changes: 1 addition & 1 deletion src/XMLConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @version 9.0.1
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
3 changes: 2 additions & 1 deletion tests/WriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function testToString()
{
$fp = fopen('php://temp', 'r+');
$csv = Writer::createFromStream($fp);
$csv->setDelimiter('|');

$expected = [
['john', 'doe', '[email protected]'],
Expand All @@ -162,7 +163,7 @@ public function testToString()
$csv->insertOne($row);
}

$expected = "john,doe,[email protected]\njane,doe,[email protected]\n";
$expected = "john|doe|[email protected]\njane|doe|[email protected]\n";
$this->assertSame($expected, $csv->__toString());
$csv = null;
fclose($fp);
Expand Down

0 comments on commit 5dc305e

Please sign in to comment.