From 0046a0c93cb29aed893af2ac05f9d58fc5d0594f Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Tue, 26 Jul 2022 18:13:39 +0200 Subject: [PATCH 1/8] Import a sheet by its name --- src/Exceptions/BadCountSheets.php | 13 ++++++++ src/Exceptions/SheetNameMissing.php | 13 ++++++++ src/Importable.php | 46 +++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 src/Exceptions/BadCountSheets.php create mode 100644 src/Exceptions/SheetNameMissing.php diff --git a/src/Exceptions/BadCountSheets.php b/src/Exceptions/BadCountSheets.php new file mode 100644 index 0000000..3644a2a --- /dev/null +++ b/src/Exceptions/BadCountSheets.php @@ -0,0 +1,13 @@ +reader($path); + + if(iterator_count($reader->getSheetIterator()) < 2){ + throw new BadCountSheets(); + } + + $sheetIndex = $this->getSheetByName($reader, $name); + + if($sheetIndex === -1){ + throw new SheetNameMissing($name); + } + + return $this + ->sheet($sheetIndex) + ->import($path, $callback); + } + + private function getSheetByName(ReaderInterface $reader, $name) + { + $sheetIndex = -1; + + foreach ($reader->getSheetIterator() as $key => $sheet) { + if ($sheet->getName() == $name) { + $sheetIndex = $key; + break; + } + } + return $sheetIndex; + } + /** * @param $path * From 3541040429c6c1cfbc201b32b9995c332688e608 Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Tue, 26 Jul 2022 18:13:51 +0200 Subject: [PATCH 2/8] Add tests --- tests/FastExcelTest.php | 45 +++++++++++++++++++++++++++++++++++++ tests/testMultiSheets.xlsx | Bin 0 -> 6529 bytes 2 files changed, 45 insertions(+) create mode 100644 tests/testMultiSheets.xlsx diff --git a/tests/FastExcelTest.php b/tests/FastExcelTest.php index 16b720b..f985544 100644 --- a/tests/FastExcelTest.php +++ b/tests/FastExcelTest.php @@ -4,6 +4,8 @@ use OpenSpout\Common\Entity\Style\Color; use OpenSpout\Writer\Common\Creator\Style\StyleBuilder; +use Rap2hpoutre\FastExcel\Exceptions\BadCountSheets; +use Rap2hpoutre\FastExcel\Exceptions\SheetNameMissing; use Rap2hpoutre\FastExcel\FastExcel; use Rap2hpoutre\FastExcel\SheetCollection; @@ -216,4 +218,47 @@ public function testExportWithHeaderStyle() unlink($file); } + + /** + * @throws \OpenSpout\Common\Exception\IOException + * @throws \OpenSpout\Common\Exception\InvalidArgumentException + * @throws \OpenSpout\Common\Exception\UnsupportedTypeException + * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException + * @throws \OpenSpout\Writer\Exception\WriterNotOpenedException + */ + public function testImportBySheetNameXLSX() + { + $collection = (new FastExcel())->importBySheetName(__DIR__.'/testMultiSheets.xlsx', 'Sheet 2'); + $this->assertEquals($this->collection(), $collection); + } + + /** + * @throws \OpenSpout\Common\Exception\IOException + * @throws \OpenSpout\Common\Exception\InvalidArgumentException + * @throws \OpenSpout\Common\Exception\UnsupportedTypeException + * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException + * @throws \OpenSpout\Writer\Exception\WriterNotOpenedException + */ + public function testSheetNameDoesNotExists() + { + $this->expectException(SheetNameMissing::class); + $this->expectExceptionMessage('Sheet name [Sheet C] is missing.'); + + (new FastExcel())->importBySheetName(__DIR__.'/testMultiSheets.xlsx', 'Sheet C'); + } + + /** + * @throws \OpenSpout\Common\Exception\IOException + * @throws \OpenSpout\Common\Exception\InvalidArgumentException + * @throws \OpenSpout\Common\Exception\UnsupportedTypeException + * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException + * @throws \OpenSpout\Writer\Exception\WriterNotOpenedException + */ + public function testBadCountSheets() + { + $this->expectException(BadCountSheets::class); + $this->expectExceptionMessage('You file does not contains more than one sheet.'); + + (new FastExcel())->importBySheetName(__DIR__.'/test1.xlsx', 'Sheet C'); + } } diff --git a/tests/testMultiSheets.xlsx b/tests/testMultiSheets.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..9595f267f99567d9e9018f28d4b0f00e14325de3 GIT binary patch literal 6529 zcmZ`;1z3}9+a3&tf|PVhr!)#EDJ7+JH;f)g35bL+=@4)rN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@&r@lt1>k1!Q_VAV*WFgV$Pc!{T~eh!V^myCaZ zQen{h!&BQz^dE8WDCVq|qPpgH);bn0dE)1PUhBW*d~?MTQJY&5>v#WcAnoMn26l8a z(e!!-b~XCj{;q-bJO0|=FJ<3CVC1@*TAdbZGvIK|Q#6)Trl4c`S;^zGDCuyH6$}Em zI5q)sGtMKfuPzH$papxm<*3`}<9AZwZ+7e8j8mFEd| zpSPpdDB(<13$|UVV(OvDcfk4p`<`9Dl2=LGYZb{=2gl#W#;~=&wW`82BnYpHMtY)bofsnP&A3Qiz6X*nl6b(c#L8GTL6TbL` zc|?(qOsRvH)wbPaHnwn|KERZ?2m1bKr=H;LdXCsC>gtNmBPQHpA(qgY5I>oNmqrHjAmrJ%(&$s23BI2@4;~*#Cm%MW zieof%aa08R_c1kU`O5Lf(E2*?>Kyk^6gkRW{%5Lt9e#BZ`X`(O6=(ko|Ib|XI{ND5 z@lW(J3Vm%3c^!Op3il_N7~>cCFEhF8JXc3kfAYwqsyWn`xIU=5PH?p~`I8_7=f5ic zr%}1ia Date: Tue, 26 Jul 2022 18:15:20 +0200 Subject: [PATCH 3/8] Rename method to get sheet index by name --- src/Importable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Importable.php b/src/Importable.php index ea56096..f4c6a98 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -103,7 +103,7 @@ public function importBySheetName($path, $name, callable $callback = null) throw new BadCountSheets(); } - $sheetIndex = $this->getSheetByName($reader, $name); + $sheetIndex = $this->getSheetIndexByName($reader, $name); if($sheetIndex === -1){ throw new SheetNameMissing($name); @@ -114,7 +114,7 @@ public function importBySheetName($path, $name, callable $callback = null) ->import($path, $callback); } - private function getSheetByName(ReaderInterface $reader, $name) + private function getSheetIndexByName(ReaderInterface $reader, $name) { $sheetIndex = -1; From f65000bd3f2be3b2b481e8ed8175c2d424bfa67b Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Tue, 26 Jul 2022 18:16:39 +0200 Subject: [PATCH 4/8] Fix style --- src/Exceptions/BadCountSheets.php | 2 +- src/Importable.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Exceptions/BadCountSheets.php b/src/Exceptions/BadCountSheets.php index 3644a2a..be6f651 100644 --- a/src/Exceptions/BadCountSheets.php +++ b/src/Exceptions/BadCountSheets.php @@ -8,6 +8,6 @@ class BadCountSheets extends Exception { public function __construct() { - parent::__construct("You file does not contains more than one sheet."); + parent::__construct('You file does not contains more than one sheet.'); } } diff --git a/src/Importable.php b/src/Importable.php index f4c6a98..8e43bdb 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -99,13 +99,13 @@ public function importBySheetName($path, $name, callable $callback = null) { $reader = $this->reader($path); - if(iterator_count($reader->getSheetIterator()) < 2){ + if (iterator_count($reader->getSheetIterator()) < 2) { throw new BadCountSheets(); } $sheetIndex = $this->getSheetIndexByName($reader, $name); - if($sheetIndex === -1){ + if ($sheetIndex === -1) { throw new SheetNameMissing($name); } From 4290a72dde80ae71cbbc74cc40bbb37b1d0ab7e4 Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Tue, 26 Jul 2022 18:17:17 +0200 Subject: [PATCH 5/8] Fix style : missing line break --- src/Importable.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Importable.php b/src/Importable.php index 8e43bdb..6569839 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -124,6 +124,7 @@ private function getSheetIndexByName(ReaderInterface $reader, $name) break; } } + return $sheetIndex; } From 03f99ad6ba1c2bc1cc7c9d8fa92d18924599a6b6 Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Wed, 27 Jul 2022 11:07:48 +0200 Subject: [PATCH 6/8] Refactoring using same way that sheet method --- src/FastExcel.php | 12 ++++++++ src/Importable.php | 65 +++++++++++++++++------------------------ tests/FastExcelTest.php | 6 ++-- 3 files changed, 41 insertions(+), 42 deletions(-) diff --git a/src/FastExcel.php b/src/FastExcel.php index a9e4d07..5f98d6b 100644 --- a/src/FastExcel.php +++ b/src/FastExcel.php @@ -98,6 +98,18 @@ public function sheet($sheet_number) return $this; } + /** + * @param $sheet_name + * + * @return $this + */ + public function sheetName($sheet_name) + { + $this->sheet_name = $sheet_name; + + return $this; + } + /** * @return $this */ diff --git a/src/Importable.php b/src/Importable.php index 6569839..fe8cd7d 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -14,7 +14,7 @@ /** * Trait Importable. * - * @property int $start_row + * @property int $start_row * @property bool $transpose * @property bool $with_header */ @@ -25,6 +25,11 @@ trait Importable */ private $sheet_number = 1; + /** + * @var string|null + */ + private $sheet_name = null; + /** * @param \OpenSpout\Reader\ReaderInterface|\OpenSpout\Writer\WriterInterface $reader_or_writer * @@ -33,19 +38,23 @@ trait Importable abstract protected function setOptions(&$reader_or_writer); /** - * @param string $path + * @param string $path * @param callable|null $callback * - * @throws \OpenSpout\Common\Exception\IOException + * @return Collection * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException * - * @return Collection + * @throws \OpenSpout\Common\Exception\IOException */ public function import($path, callable $callback = null) { $reader = $this->reader($path); + if ($this->sheet_name !== null) { + $this->setSheetIndexByName($reader); + } + foreach ($reader->getSheetIterator() as $key => $sheet) { if ($this->sheet_number != $key) { continue; @@ -58,14 +67,14 @@ public function import($path, callable $callback = null) } /** - * @param string $path + * @param string $path * @param callable|null $callback * - * @throws \OpenSpout\Common\Exception\IOException + * @return Collection * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException * - * @return Collection + * @throws \OpenSpout\Common\Exception\IOException */ public function importSheets($path, callable $callback = null) { @@ -84,57 +93,35 @@ public function importSheets($path, callable $callback = null) return new SheetCollection($collections); } - /** - * @param string $path - * @param string $name - * @param callable|null $callback - * - * @throws \OpenSpout\Common\Exception\IOException - * @throws \OpenSpout\Common\Exception\UnsupportedTypeException - * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException - * - * @return Collection - */ - public function importBySheetName($path, $name, callable $callback = null) + private function setSheetIndexByName(ReaderInterface $reader) { - $reader = $this->reader($path); - if (iterator_count($reader->getSheetIterator()) < 2) { throw new BadCountSheets(); } - $sheetIndex = $this->getSheetIndexByName($reader, $name); - - if ($sheetIndex === -1) { - throw new SheetNameMissing($name); - } - - return $this - ->sheet($sheetIndex) - ->import($path, $callback); - } - - private function getSheetIndexByName(ReaderInterface $reader, $name) - { $sheetIndex = -1; foreach ($reader->getSheetIterator() as $key => $sheet) { - if ($sheet->getName() == $name) { + if ($sheet->getName() == $this->sheet_name) { $sheetIndex = $key; break; } } - return $sheetIndex; + if ($sheetIndex === -1) { + throw new SheetNameMissing($this->sheet_name); + } + + $this->sheet($sheetIndex); } /** * @param $path * - * @throws \OpenSpout\Common\Exception\IOException + * @return \OpenSpout\Reader\ReaderInterface * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * - * @return \OpenSpout\Reader\ReaderInterface + * @throws \OpenSpout\Common\Exception\IOException */ private function reader($path) { @@ -175,7 +162,7 @@ private function transposeCollection(array $array) /** * @param SheetInterface $sheet - * @param callable|null $callback + * @param callable|null $callback * * @return array */ diff --git a/tests/FastExcelTest.php b/tests/FastExcelTest.php index f985544..00c2686 100644 --- a/tests/FastExcelTest.php +++ b/tests/FastExcelTest.php @@ -228,7 +228,7 @@ public function testExportWithHeaderStyle() */ public function testImportBySheetNameXLSX() { - $collection = (new FastExcel())->importBySheetName(__DIR__.'/testMultiSheets.xlsx', 'Sheet 2'); + $collection = (new FastExcel())->sheetName('Sheet 2')->import(__DIR__.'/testMultiSheets.xlsx'); $this->assertEquals($this->collection(), $collection); } @@ -244,7 +244,7 @@ public function testSheetNameDoesNotExists() $this->expectException(SheetNameMissing::class); $this->expectExceptionMessage('Sheet name [Sheet C] is missing.'); - (new FastExcel())->importBySheetName(__DIR__.'/testMultiSheets.xlsx', 'Sheet C'); + (new FastExcel())->sheetName('Sheet C')->import(__DIR__.'/testMultiSheets.xlsx'); } /** @@ -259,6 +259,6 @@ public function testBadCountSheets() $this->expectException(BadCountSheets::class); $this->expectExceptionMessage('You file does not contains more than one sheet.'); - (new FastExcel())->importBySheetName(__DIR__.'/test1.xlsx', 'Sheet C'); + (new FastExcel())->sheetName('Sheet C')->import(__DIR__.'/test1.xlsx'); } } From c8fc35e3680a0ceb52c560743b12f2a340a683e1 Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Wed, 27 Jul 2022 11:11:07 +0200 Subject: [PATCH 7/8] Fix style --- src/Importable.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Importable.php b/src/Importable.php index fe8cd7d..0e3b684 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -14,7 +14,7 @@ /** * Trait Importable. * - * @property int $start_row + * @property int $start_row * @property bool $transpose * @property bool $with_header */ @@ -38,14 +38,15 @@ trait Importable abstract protected function setOptions(&$reader_or_writer); /** - * @param string $path + * @param string $path * @param callable|null $callback * - * @return Collection * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException * * @throws \OpenSpout\Common\Exception\IOException + * + * @return Collection */ public function import($path, callable $callback = null) { @@ -67,14 +68,15 @@ public function import($path, callable $callback = null) } /** - * @param string $path + * @param string $path * @param callable|null $callback * - * @return Collection * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException * * @throws \OpenSpout\Common\Exception\IOException + * + * @return Collection */ public function importSheets($path, callable $callback = null) { @@ -118,10 +120,11 @@ private function setSheetIndexByName(ReaderInterface $reader) /** * @param $path * - * @return \OpenSpout\Reader\ReaderInterface * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * * @throws \OpenSpout\Common\Exception\IOException + * + * @return \OpenSpout\Reader\ReaderInterface */ private function reader($path) { @@ -162,7 +165,7 @@ private function transposeCollection(array $array) /** * @param SheetInterface $sheet - * @param callable|null $callback + * @param callable|null $callback * * @return array */ From ed69b20d3a33113ea0bdcf053f0195133964d4d4 Mon Sep 17 00:00:00 2001 From: Julien Roche Date: Wed, 27 Jul 2022 11:11:51 +0200 Subject: [PATCH 8/8] Fix style --- src/Importable.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Importable.php b/src/Importable.php index 0e3b684..eb48107 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -43,7 +43,6 @@ abstract protected function setOptions(&$reader_or_writer); * * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException - * * @throws \OpenSpout\Common\Exception\IOException * * @return Collection @@ -73,7 +72,6 @@ public function import($path, callable $callback = null) * * @throws \OpenSpout\Common\Exception\UnsupportedTypeException * @throws \OpenSpout\Reader\Exception\ReaderNotOpenedException - * * @throws \OpenSpout\Common\Exception\IOException * * @return Collection @@ -121,7 +119,6 @@ private function setSheetIndexByName(ReaderInterface $reader) * @param $path * * @throws \OpenSpout\Common\Exception\UnsupportedTypeException - * * @throws \OpenSpout\Common\Exception\IOException * * @return \OpenSpout\Reader\ReaderInterface