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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.