Add methods to SheetInterface

The SheetInterface was missing methods common to all Sheets (getIndex, getName, isActive, isVisible).
This commit is contained in:
Adrien Loison 2019-05-17 21:33:09 +02:00
parent 40ee386edd
commit cd3d98fb1a
2 changed files with 29 additions and 3 deletions

View File

@ -51,4 +51,12 @@ class Sheet implements SheetInterface
{ {
return true; return true;
} }
/**
* @return bool Always TRUE as the only sheet is always visible
*/
public function isVisible()
{
return true;
}
} }

View File

@ -8,9 +8,27 @@ namespace Box\Spout\Reader;
interface SheetInterface interface SheetInterface
{ {
/** /**
* Returns an iterator to iterate over the sheet's rows. * @return IteratorInterface Iterator to iterate over the sheet's rows.
*
* @return IteratorInterface
*/ */
public function getRowIterator(); public function getRowIterator();
/**
* @return int Index of the sheet
*/
public function getIndex();
/**
* @return string Name of the sheet
*/
public function getName();
/**
* @return bool Whether the sheet was defined as active
*/
public function isActive();
/**
* @return bool Whether the sheet is visible
*/
public function isVisible();
} }