Skip to content

Commit

Permalink
prepare 9.1.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Mar 5, 2018
1 parent 2e412a3 commit e77a0bc
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 40 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

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

## Next - TBD

### Added

- Nothing

### Deprecated

- Nothing

### Fixed

- `Writer::insertOne` allow empty array to be added to the CSV (allow inserting empty row)
- Removed all return type from named constructor see [#285](https://github.com/thephpleague/csv/pull/285)
- Added PHPStan for static code analysis

### Removed

- Nothing

## 9.1.2 - 2018-02-05

### 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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
4 changes: 2 additions & 2 deletions 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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -176,7 +176,7 @@ public function filter($in, $out, &$consumed, $closing)
*/
public function convert($records)
{
if (!is_iterable($records)) {
if (!\is_iterable($records)) {
throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
}

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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/EncloseField.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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
2 changes: 1 addition & 1 deletion src/EscapeFormula.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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
4 changes: 2 additions & 2 deletions 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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -297,7 +297,7 @@ public function setFlags(int $flags)
* @param string $enclosure
* @param string $escape
*
* @return int|bool
* @return int|null|bool
*/
public function fputcsv(array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = '\\')
{
Expand Down
6 changes: 3 additions & 3 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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -97,7 +97,7 @@ public function getFlushThreshold()
*/
public function insertAll($records): int
{
if (!is_iterable($records)) {
if (!\is_iterable($records)) {
throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
}

Expand Down Expand Up @@ -129,7 +129,7 @@ public function insertOne(array $record): int
$record = array_reduce($this->formatters, [$this, 'formatRecord'], $record);
$this->validateRecord($record);
$bytes = $this->document->fputcsv($record, $this->delimiter, $this->enclosure, $this->escape);
if (false !== $bytes) {
if (false !== $bytes && null !== $bytes) {
return $bytes + $this->consolidate();
}

Expand Down
4 changes: 2 additions & 2 deletions 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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -90,7 +90,7 @@ class XMLConverter
*/
public function convert($records): DOMDocument
{
if (!is_iterable($records)) {
if (!\is_iterable($records)) {
throw new TypeError(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($records)));
}

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.1.2
* @version 9.1.3
* @package League.csv
*
* For the full copyright and license information, please view the LICENSE
Expand Down
23 changes: 6 additions & 17 deletions tests/CsvTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use League\Csv\Writer;
use PHPUnit\Framework\TestCase;
use SplTempFileObject;
use TypeError;

/**
* @group csv
Expand Down Expand Up @@ -66,16 +65,6 @@ public function testCreateFromPathThrowsRuntimeException()
Reader::createFromPath(__DIR__.'/foo/bar', 'r');
}

/**
* @covers ::createFromStream
*/
public function testCreateFromStreamWithInvalidParameter()
{
$this->expectException(TypeError::class);
$path = __DIR__.'/data/foo.csv';
Reader::createFromStream($path);
}

/**
* @covers ::getInputBOM
*
Expand Down Expand Up @@ -384,13 +373,13 @@ public function testIsIterablePolyFill()
$this->markTestSkipped('Polyfill for PHP7.0');
}

$this->assertTrue(\is_iterable(['foo']));
$this->assertTrue(\is_iterable(Reader::createFromString('')));
$this->assertTrue(\is_iterable((function () {
$this->assertTrue(is_iterable(['foo']));
$this->assertTrue(is_iterable(Reader::createFromString('')));
$this->assertTrue(is_iterable((function () {
yield 1;
})()));
$this->assertFalse(\is_iterable(1));
$this->assertFalse(\is_iterable((object) ['foo']));
$this->assertFalse(\is_iterable(Writer::createFromString('')));
$this->assertFalse(is_iterable(1));
$this->assertFalse(is_iterable((object) ['foo']));
$this->assertFalse(is_iterable(Writer::createFromString('')));
}
}

0 comments on commit e77a0bc

Please sign in to comment.