File tree Expand file tree Collapse file tree 5 files changed +17
-5
lines changed
Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1010use Box \Spout \Writer \Exception \WriterNotOpenedException ;
1111use Box \Spout \Writer \WriterInterface ;
1212use Kiboko \Component \Bucket \AcceptanceResultBucket ;
13+ use Kiboko \Component \Bucket \EmptyResultBucket ;
14+ use Kiboko \Contract \Bucket \ResultBucketInterface ;
15+ use Kiboko \Contract \Pipeline \FlushableInterface ;
1316use Kiboko \Contract \Pipeline \LoaderInterface ;
1417use Psr \Log \LoggerInterface ;
1518use Psr \Log \NullLogger ;
@@ -24,7 +27,7 @@ public function __construct(
2427
2528 public function load (): \Generator
2629 {
27- $ line = yield ;
30+ $ line = yield new EmptyResultBucket () ;
2831 $ headers = array_keys ($ line );
2932 try {
3033 $ this ->writer ->addRow (
@@ -36,6 +39,7 @@ public function load(): \Generator
3639 return ;
3740 }
3841
42+ /* @phpstan-ignore-next-line */
3943 while (true ) {
4044 try {
4145 $ this ->writer ->addRow ($ this ->orderColumns ($ headers , $ line ));
Original file line number Diff line number Diff line change @@ -74,9 +74,11 @@ public function load(): void
7474 'last name ' => 'dupont ' ,
7575 ],
7676 ],
77- new Loader ($ this ->writer , ' Sheet1 ' )
77+ new Loader ($ this ->writer )
7878 );
7979
80+ $ this ->writer ->close ();
81+
8082 $ this ->assertRowWasWrittenToExcel (
8183 /* 'vfs://test.xlsx' */ $ path ,
8284 'Sheet1 ' ,
Original file line number Diff line number Diff line change @@ -74,9 +74,11 @@ public function load(): void
7474 'last name ' => 'dupont ' ,
7575 ],
7676 ],
77- new Loader ($ this ->writer , ' Sheet1 ' )
77+ new Loader ($ this ->writer )
7878 );
7979
80+ $ this ->writer ->close ();
81+
8082 $ this ->assertRowWasWrittenToOpenDocument (
8183 /* 'vfs://test.ods' */ $ path ,
8284 'Sheet1 ' ,
Original file line number Diff line number Diff line change @@ -74,9 +74,11 @@ public function load(): void
7474 'last name ' => 'dupont ' ,
7575 ],
7676 ],
77- new Loader ($ this ->writer , ' Sheet1 ' )
77+ new Loader ($ this ->writer )
7878 );
7979
80+ $ this ->writer ->close ();
81+
8082 $ this ->assertRowWasWrittenToExcel (
8183 /* 'vfs://test.xlsx' */ $ path ,
8284 'Sheet1 ' ,
Original file line number Diff line number Diff line change @@ -74,9 +74,11 @@ public function load(): void
7474 'last name ' => 'dupont ' ,
7575 ],
7676 ],
77- new Loader ($ this ->writer , ' Sheet1 ' )
77+ new Loader ($ this ->writer )
7878 );
7979
80+ $ this ->writer ->close ();
81+
8082 $ this ->assertRowWasWrittenToOpenDocument (
8183 /* 'vfs://test.ods' */ $ path ,
8284 'Sheet1 ' ,
You can’t perform that action at this time.
0 commit comments