This commit is contained in:
Dominik Bonsch 2013-02-09 11:55:38 +01:00
parent 242f69bb29
commit e250e466f9

View File

@ -21,7 +21,7 @@
* @category PHPExcel * @category PHPExcel
* @package PHPExcel * @package PHPExcel
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
*/ */
@ -37,41 +37,44 @@
*/ */
class PHPExcel_WorksheetIterator implements Iterator class PHPExcel_WorksheetIterator implements Iterator
{ {
/** /**
* Spreadsheet to iterate * Spreadsheet to iterate
* *
* @var PHPExcel * @var PHPExcel
*/ */
private $_subject; private $_subject;
/** /**
* Current iterator position * Current iterator position
* *
* @var int * @var int
*/ */
private $_position = 0; private $_position = 0;
/** /**
* Create a new worksheet iterator * Create a new worksheet iterator
* *
* @param PHPExcel $subject * @param PHPExcel $subject
*/ */
public function __construct(PHPExcel $subject = null) { public function __construct(PHPExcel $subject = null)
// Set subject {
$this->_subject = $subject; // Set subject
} $this->_subject = $subject;
}
/** /**
* Destructor * Destructor
*/ */
public function __destruct() { public function __destruct()
unset($this->_subject); {
} unset($this->_subject);
}
/** /**
* Rewind iterator * Rewind iterator
*/ */
public function rewind() { public function rewind()
{
$this->_position = 0; $this->_position = 0;
} }
@ -80,8 +83,9 @@ class PHPExcel_WorksheetIterator implements Iterator
* *
* @return PHPExcel_Worksheet * @return PHPExcel_Worksheet
*/ */
public function current() { public function current()
return $this->_subject->getSheet($this->_position); {
return $this->_subject->getSheet($this->_position);
} }
/** /**
@ -89,14 +93,16 @@ class PHPExcel_WorksheetIterator implements Iterator
* *
* @return int * @return int
*/ */
public function key() { public function key()
{
return $this->_position; return $this->_position;
} }
/** /**
* Next value * Next value
*/ */
public function next() { public function next()
{
++$this->_position; ++$this->_position;
} }
@ -105,7 +111,8 @@ class PHPExcel_WorksheetIterator implements Iterator
* *
* @return boolean * @return boolean
*/ */
public function valid() { public function valid()
{
return $this->_position < $this->_subject->getSheetCount(); return $this->_position < $this->_subject->getSheetCount();
} }
} }