Skip to content

Commit

Permalink
prepare 9.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Aug 18, 2017
1 parent fcab5ba commit 60ea563
Show file tree
Hide file tree
Showing 20 changed files with 85 additions and 88 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

## 9.0.0 - TBD
## 9.0.0 - 2017-08-18

### Added

Expand Down
23 changes: 11 additions & 12 deletions docs/_data/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@ google_analytics_tracking_id: UA-46050814-6
# Github repository
repository: 'csv'
releases:
next:
# next:
# version: '10.0'
# requires: 'PHP >= 5.5.0'
# latest: '8.2.1 - 2017-02-03'
# supported_until: 'TBD'
# documentation_link: '/8.0/'
current:
version: '9.0'
requires: 'PHP >= 7.0.10'
latest: 'TBD'
latest: '9.0.0 - 2017-08-18'
supported_until: 'TBD'
documentation_link: '/9.0/'
current:
previous:
version: '8.0'
requires: 'PHP >= 5.5.0'
latest: '8.2.1 - 2017-02-03'
supported_until: 'TBD'
latest: '8.2.2 - 2017-07-12'
supported_until: '2018-02-18'
documentation_link: '/8.0/'
# Uncomment if needed
# previous:
# version: '8.0'
# requires: 'PHP >= 5.5.0'
# latest: '8.2.1 - 2017-02-03'
# supported_until: 'TBD'
# documentation_link: '/8.0/'
legacy:
version: '7.0'
requires: 'PHP >= 5.4.0'
Expand Down
2 changes: 1 addition & 1 deletion docs/_layouts/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h2>Current Stable</h2>
{% endif %}
{% if site.data.project.releases.previous %}
<div class="version previous">
<h2>Unsupported</h2>
<h2>Old Stable Release</h2>
<div class="content">
<p><code>league/{{ site.data.project.title | downcase }}:^{{ site.data.project.releases.previous.version }}</code></p>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/upgrading/9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: default
title: Upgrading from 8.x to 9.x
---

<p class="message-notice">This is the documentation for the upcoming <code>version 9.0</code>. This is a work in progress.</p>
<!--p class="message-notice">This is the documentation for the upcoming <code>version 9.0</code>. This is a work in progress.</p-->

# Upgrading from 8.x to 9.x

Expand Down
1 change: 0 additions & 1 deletion src/AbstractCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* @package League.csv
* @since 4.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
abstract class AbstractCsv implements ByteSequence
{
Expand Down
1 change: 0 additions & 1 deletion src/ByteSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @package League.csv
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
interface ByteSequence
{
Expand Down
1 change: 0 additions & 1 deletion src/CannotInsertRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* @package League.csv
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
class CannotInsertRecord extends Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/CharsetConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use TypeError;

/**
* A class to convert your CSV records collection charset
* A class to convert resource stream or tabular data content charset
*
* @package League.csv
* @since 9.0.0
Expand Down
3 changes: 1 addition & 2 deletions src/ColumnConsistency.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
namespace League\Csv;

/**
* A class to manage column consistency on data insertion into a CSV
* A class to validate column consistency when inserting records into a CSV document
*
* @package League.csv
* @since 7.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
class ColumnConsistency
{
Expand Down
3 changes: 1 addition & 2 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
namespace League\Csv;

/**
* League Csv Base Exception
* League Csv Base Exception
*
* @package League.csv
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
class Exception extends \Exception
{
Expand Down
4 changes: 2 additions & 2 deletions src/HTMLConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Traversable;

/**
* A class to convert CSV records into an HTML Table string
* A class to convert tabular data into an HTML Table string
*
* @package League.csv
* @since 9.0.0
Expand Down Expand Up @@ -60,7 +60,7 @@ public function __construct()
/**
* Convert an Record collection into a DOMDocument
*
* @param array|Traversable $records the CSV records collection
* @param array|Traversable $records the tabular data collection
*
* @return string
*/
Expand Down
1 change: 0 additions & 1 deletion src/MapIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* @since 3.3.0
* @author Ignace Nyamagana Butera <[email protected]>
* @internal used internally to modify CSV content
*
*/
class MapIterator extends IteratorIterator
{
Expand Down
2 changes: 2 additions & 0 deletions src/RFC4180Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/**
* A stream filter to conform the CSV field to RFC4180
*
* @see https://tools.ietf.org/html/rfc4180#section-2
*
* @package League.csv
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
Expand Down
33 changes: 17 additions & 16 deletions src/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use TypeError;

/**
* A class to manage records selection from a CSV document
* A class to select records from a CSV document
*
* @package League.csv
* @since 3.0.0
Expand All @@ -36,21 +36,21 @@
class Reader extends AbstractCsv implements Countable, IteratorAggregate, JsonSerializable
{
/**
* CSV Document header offset
* header offset
*
* @var int|null
*/
protected $header_offset;

/**
* CSV Document Header record
* header record
*
* @var string[]
*/
protected $header = [];

/**
* Records count
* records count
*
* @var int
*/
Expand All @@ -62,9 +62,9 @@ class Reader extends AbstractCsv implements Countable, IteratorAggregate, JsonSe
protected $stream_filter_mode = STREAM_FILTER_READ;

/**
* Returns the record offset used as header
* Returns the header offset
*
* If no CSV record is used this method MUST return null
* If no CSV header offset is set this method MUST return null
*
* @return int|null
*/
Expand All @@ -74,7 +74,7 @@ public function getHeaderOffset()
}

/**
* Returns the CSV record header
* Returns the CSV record used as header
*
* The returned header is represented as an array of string values
*
Expand All @@ -100,8 +100,7 @@ public function getHeader(): array
*
* @param int $offset
*
* @throws Exception If the header offset is an integer and the corresponding record is missing
* or is an empty array
* @throws Exception If the header offset is set and no record is found or is the empty array
*
* @return string[]
*/
Expand Down Expand Up @@ -151,7 +150,7 @@ protected function removeBOM(array $record, int $bom_length, string $enclosure):
*/
public function __call($method, array $arguments)
{
$whitelisted = ['fetchColumn' => 1, 'fetchOne' => 1, 'fetchPairs' => 1];
static $whitelisted = ['fetchColumn' => 1, 'fetchOne' => 1, 'fetchPairs' => 1];
if (isset($whitelisted[$method])) {
return (new ResultSet($this->getRecords(), $this->getHeader()))->$method(...$arguments);
}
Expand Down Expand Up @@ -188,12 +187,12 @@ public function jsonSerialize(): array
}

/**
* Returns the CSV records in an iterator object.
* Returns the CSV records as an iterator object.
*
* Each CSV record is represented as a simple array of string or null values.
* Each CSV record is represented as a simple array containig strings or null values.
*
* If the CSV document has a header record then each record is combined
* to each header record and the header record is removed from the iterator.
* to the header record and the header record is removed from the iterator.
*
* If the CSV document is inconsistent. Missing record fields are
* filled with null values while extra record fields are strip from
Expand Down Expand Up @@ -246,7 +245,7 @@ protected function computeHeader(array $header)
}

/**
* Add the CSV header if present and valid
* Combine the CSV header to each record if present
*
* @param Iterator $iterator
* @param string[] $header
Expand All @@ -272,7 +271,7 @@ protected function combineHeader(Iterator $iterator, array $header): Iterator
}

/**
* Strip the BOM sequence if present
* Strip the BOM sequence from the returned records if necessary
*
* @param Iterator $iterator
* @param string $bom
Expand Down Expand Up @@ -300,11 +299,13 @@ protected function stripBOM(Iterator $iterator, string $bom): Iterator
/**
* Selects the record to be used as the CSV header
*
* Because of the header is represented as an array, to be valid
* Because the header is represented as an array, to be valid
* a header MUST contain only unique string value.
*
* @param int|null $offset the header record offset
*
* @throws Exception if the offset is a negative integer
*
* @return static
*/
public function setHeaderOffset($offset): self
Expand Down
19 changes: 9 additions & 10 deletions src/ResultSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @package League.csv
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
*
*/
class ResultSet implements Countable, IteratorAggregate, JsonSerializable
{
Expand All @@ -40,7 +39,7 @@ class ResultSet implements Countable, IteratorAggregate, JsonSerializable
protected $records;

/**
* The CSV records collection column names
* The CSV records collection header
*
* @var array
*/
Expand All @@ -67,7 +66,7 @@ public function __destruct()
}

/**
* Returns the column names associated with the ResultSet
* Returns the header associated with the result set
*
* @return string[]
*/
Expand Down Expand Up @@ -111,7 +110,7 @@ public function jsonSerialize(): array
}

/**
* Returns a the nth record from the resultset
* Returns the nth record from the result set
*
* By default if no index is provided the first record of the resultet is returned
*
Expand All @@ -134,9 +133,9 @@ public function fetchOne(int $nth_record = 0): array
}

/**
* Returns the next value from a single CSV record field
* Returns a single column from the next record of the result set
*
* By default if no column index is provided the first column of the CSV is selected
* By default if no value is supplied the first column is fetch
*
* @param string|int $index CSV column index
*
Expand All @@ -160,7 +159,7 @@ public function fetchColumn($index = 0): Generator
}

/**
* Filter a column name against the CSV header if any
* Filter a column name against the header if any
*
* @param string|int $field the field name or the field index
* @param string $error_message the associated error message
Expand Down Expand Up @@ -222,12 +221,12 @@ protected function getColumnIndexByKey(int $index, string $error_message)
}

/**
* Fetches the next key-value pairs from a result set (first
* Returns the next key-value pairs from a result set (first
* column is the key, second column is the value).
*
* By default if no column index is provided:
* - the first CSV column is used to provide the keys
* - the second CSV column is used to provide the value
* - the first column is used to provide the keys
* - the second column is used to provide the value
*
* @param string|int $offset_index The column index to serve as offset
* @param string|int $value_index The column index to serve as value
Expand Down
Loading

0 comments on commit 60ea563

Please sign in to comment.