Fix code style

This commit is contained in:
Adrien Loison committed 2017-09-06 00:33:43 +02:00
1 parent 740fcfb8c1
commit b968513cb9
171 files changed
+517 -792

No files matched your search

+12 -16
View File
@@ -2,17 +2,13 @@
namespace Box\Spout\Reader\CSV;
use Box\Spout\Common\Creator\HelperFactory;
use Box\Spout\Reader\Common\Entity\Options;
use Box\Spout\Reader\CSV\Creator\EntityFactory;
use Box\Spout\Reader\IteratorInterface;
use Box\Spout\Common\Helper\EncodingHelper;
use Box\Spout\Reader\Common\Entity\Options;
use Box\Spout\Reader\IteratorInterface;
/**
* Class RowIterator
* Iterate over CSV rows.
*
* @package Box\Spout\Reader\CSV
*/
class RowIterator implements IteratorInterface
{
@@ -28,7 +24,7 @@ class RowIterator implements IteratorInterface
protected $numReadRows = 0;
/** @var array|null Buffer used to store the row data, while checking if there are more rows to read */
protected $rowDataBuffer = null;
protected $rowDataBuffer;
/** @var bool Indicates whether all rows have been read */
protected $hasReachedEndOfFile = false;
@@ -70,7 +66,7 @@ class RowIterator implements IteratorInterface
/**
* Rewind the Iterator to the first element
* @link http://php.net/manual/en/iterator.rewind.php
* @see http://php.net/manual/en/iterator.rewind.php
*
* @return void
*/
@@ -100,7 +96,7 @@ class RowIterator implements IteratorInterface
/**
* Checks if current position is valid
* @link http://php.net/manual/en/iterator.valid.php
* @see http://php.net/manual/en/iterator.valid.php
*
* @return bool
*/
@@ -111,10 +107,10 @@ class RowIterator implements IteratorInterface
/**
* Move forward to next element. Reads data for the next unprocessed row.
* @link http://php.net/manual/en/iterator.next.php
* @see http://php.net/manual/en/iterator.next.php
*
* @return void
* @throws \Box\Spout\Common\Exception\EncodingConversionException If unable to convert data to UTF-8
* @return void
*/
public function next()
{
@@ -126,8 +122,8 @@ class RowIterator implements IteratorInterface
}
/**
* @return void
* @throws \Box\Spout\Common\Exception\EncodingConversionException If unable to convert data to UTF-8
* @return void
*/
protected function readDataForNextRow()
{
@@ -167,8 +163,8 @@ class RowIterator implements IteratorInterface
* As fgetcsv() does not manage correctly encoding for non UTF-8 data,
* we remove manually whitespace with ltrim or rtrim (depending on the order of the bytes)
*
* @return array|false The row for the current file pointer, encoded in UTF-8 or FALSE if nothing to read
* @throws \Box\Spout\Common\Exception\EncodingConversionException If unable to convert data to UTF-8
* @return array|false The row for the current file pointer, encoded in UTF-8 or FALSE if nothing to read
*/
protected function getNextUTF8EncodedRow()
{
@@ -178,7 +174,7 @@ class RowIterator implements IteratorInterface
}
foreach ($encodedRowData as $cellIndex => $cellValue) {
switch($this->encoding) {
switch ($this->encoding) {
case EncodingHelper::ENCODING_UTF16_LE:
case EncodingHelper::ENCODING_UTF32_LE:
// remove whitespace from the beginning of a string as fgetcsv() add extra whitespace when it try to explode non UTF-8 data
@@ -209,7 +205,7 @@ class RowIterator implements IteratorInterface
/**
* Return the current element from the buffer
* @link http://php.net/manual/en/iterator.current.php
* @see http://php.net/manual/en/iterator.current.php
*
* @return array|null
*/
@@ -220,7 +216,7 @@ class RowIterator implements IteratorInterface
/**
* Return the key of the current element
* @link http://php.net/manual/en/iterator.key.php
* @see http://php.net/manual/en/iterator.key.php
*
* @return int
*/