Merge 7dd91ee3cecfa27cb66d9779859fd10ca1627deb into 84596668410bea89d21aa9867b91e1550e359329
This commit is contained in:
commit
04392c1e0a
@ -8,13 +8,13 @@ use Box\Spout\Common\Helper\GlobalFunctionsHelper;
|
|||||||
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
||||||
use Box\Spout\Reader\Common\Entity\Options;
|
use Box\Spout\Reader\Common\Entity\Options;
|
||||||
use Box\Spout\Reader\CSV\Creator\InternalEntityFactory;
|
use Box\Spout\Reader\CSV\Creator\InternalEntityFactory;
|
||||||
use Box\Spout\Reader\IteratorInterface;
|
use Box\Spout\Reader\RowIteratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RowIterator
|
* Class RowIterator
|
||||||
* Iterate over CSV rows.
|
* Iterate over CSV rows.
|
||||||
*/
|
*/
|
||||||
class RowIterator implements IteratorInterface
|
class RowIterator implements RowIteratorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Value passed to fgetcsv. 0 means "unlimited" (slightly slower but accomodates for very long lines).
|
* Value passed to fgetcsv. 0 means "unlimited" (slightly slower but accomodates for very long lines).
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace Box\Spout\Reader\CSV;
|
namespace Box\Spout\Reader\CSV;
|
||||||
|
|
||||||
use Box\Spout\Reader\IteratorInterface;
|
use Box\Spout\Reader\SheetIteratorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SheetIterator
|
* Class SheetIterator
|
||||||
* Iterate over CSV unique "sheet".
|
* Iterate over CSV unique "sheet".
|
||||||
*/
|
*/
|
||||||
class SheetIterator implements IteratorInterface
|
class SheetIterator implements SheetIteratorInterface
|
||||||
{
|
{
|
||||||
/** @var Sheet The CSV unique "sheet" */
|
/** @var Sheet The CSV unique "sheet" */
|
||||||
protected $sheet;
|
protected $sheet;
|
||||||
|
@ -7,6 +7,7 @@ use Box\Spout\Common\Helper\GlobalFunctionsHelper;
|
|||||||
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
use Box\Spout\Common\Manager\OptionsManagerInterface;
|
||||||
use Box\Spout\Reader\Common\Creator\InternalEntityFactoryInterface;
|
use Box\Spout\Reader\Common\Creator\InternalEntityFactoryInterface;
|
||||||
use Box\Spout\Reader\Common\Entity\Options;
|
use Box\Spout\Reader\Common\Entity\Options;
|
||||||
|
use Box\Spout\Reader\CSV\SheetIterator;
|
||||||
use Box\Spout\Reader\Exception\ReaderNotOpenedException;
|
use Box\Spout\Reader\Exception\ReaderNotOpenedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +47,7 @@ abstract class ReaderAbstract implements ReaderInterface
|
|||||||
/**
|
/**
|
||||||
* Returns an iterator to iterate over sheets.
|
* Returns an iterator to iterate over sheets.
|
||||||
*
|
*
|
||||||
* @return IteratorInterface To iterate over sheets
|
* @return SheetIteratorInterface To iterate over sheets
|
||||||
*/
|
*/
|
||||||
abstract protected function getConcreteSheetIterator();
|
abstract protected function getConcreteSheetIterator();
|
||||||
|
|
||||||
@ -211,7 +212,7 @@ abstract class ReaderAbstract implements ReaderInterface
|
|||||||
* Returns an iterator to iterate over sheets.
|
* Returns an iterator to iterate over sheets.
|
||||||
*
|
*
|
||||||
* @throws \Box\Spout\Reader\Exception\ReaderNotOpenedException If called before opening the reader
|
* @throws \Box\Spout\Reader\Exception\ReaderNotOpenedException If called before opening the reader
|
||||||
* @return \Iterator To iterate over sheets
|
* @return SheetIteratorInterface To iterate over sheets
|
||||||
*/
|
*/
|
||||||
public function getSheetIterator()
|
public function getSheetIterator()
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ interface ReaderInterface
|
|||||||
* Returns an iterator to iterate over sheets.
|
* Returns an iterator to iterate over sheets.
|
||||||
*
|
*
|
||||||
* @throws \Box\Spout\Reader\Exception\ReaderNotOpenedException If called before opening the reader
|
* @throws \Box\Spout\Reader\Exception\ReaderNotOpenedException If called before opening the reader
|
||||||
* @return \Iterator To iterate over sheets
|
* @return SheetIteratorInterface To iterate over sheets
|
||||||
*/
|
*/
|
||||||
public function getSheetIterator();
|
public function getSheetIterator();
|
||||||
|
|
||||||
|
22
src/Spout/Reader/RowIteratorInterface.php
Normal file
22
src/Spout/Reader/RowIteratorInterface.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Box\Spout\Reader;
|
||||||
|
|
||||||
|
use Box\Spout\Common\Entity\Row;
|
||||||
|
|
||||||
|
interface RowIteratorInterface extends IteratorInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Cleans up what was created to iterate over the object.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function end();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Row|null
|
||||||
|
*/
|
||||||
|
public function current();
|
||||||
|
}
|
23
src/Spout/Reader/SheetIteratorInterface.php
Normal file
23
src/Spout/Reader/SheetIteratorInterface.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Box\Spout\Reader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface IteratorInterface
|
||||||
|
*/
|
||||||
|
interface SheetIteratorInterface extends IteratorInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Cleans up what was created to iterate over the object.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function end();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return SheetInterface|null
|
||||||
|
*/
|
||||||
|
public function current();
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user