From 69b0fb9eaf84b5f0d3803f363cc8aaf8ded64b18 Mon Sep 17 00:00:00 2001 From: Adrien Loison Date: Fri, 17 May 2019 21:33:09 +0200 Subject: [PATCH] Add methods to SheetInterface The SheetInterface was missing methods common to all Sheets (getIndex, getName, isActive, isVisible). --- src/Spout/Reader/CSV/Sheet.php | 8 ++++++++ src/Spout/Reader/SheetInterface.php | 24 +++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/Spout/Reader/CSV/Sheet.php b/src/Spout/Reader/CSV/Sheet.php index aa175d2..a3055a8 100644 --- a/src/Spout/Reader/CSV/Sheet.php +++ b/src/Spout/Reader/CSV/Sheet.php @@ -51,4 +51,12 @@ class Sheet implements SheetInterface { return true; } + + /** + * @return bool Always TRUE as the only sheet is always visible + */ + public function isVisible() + { + return true; + } } diff --git a/src/Spout/Reader/SheetInterface.php b/src/Spout/Reader/SheetInterface.php index d0a115d..f77ecdf 100644 --- a/src/Spout/Reader/SheetInterface.php +++ b/src/Spout/Reader/SheetInterface.php @@ -8,9 +8,27 @@ namespace Box\Spout\Reader; interface SheetInterface { /** - * Returns an iterator to iterate over the sheet's rows. - * - * @return IteratorInterface + * @return IteratorInterface Iterator to iterate over the sheet's rows. */ 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(); }