@@ -33,6 +33,6 @@ |
||
33 | 33 | */ |
34 | 34 | public function getHeader() |
35 | 35 | { |
36 | - return []; |
|
36 | + return [ ]; |
|
37 | 37 | } |
38 | 38 | } |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php namespace Arcanedev\LaravelExcel\Exporters; |
2 | 2 | |
3 | -use Illuminate\Support\Collection; |
|
4 | -use Box\Spout\Writer\WriterFactory; |
|
5 | -use Arcanedev\LaravelExcel\Contracts\Serializer as SerializerContract; |
|
6 | 3 | use Arcanedev\LaravelExcel\Contracts\Exporter as ExporterContract; |
4 | +use Arcanedev\LaravelExcel\Contracts\Serializer as SerializerContract; |
|
5 | +use Box\Spout\Writer\WriterFactory; |
|
6 | +use Illuminate\Support\Collection; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Class AbstractExporter |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | | ------------------------------------------------------------------------------------------------ |
19 | 19 | */ |
20 | 20 | /** @var array */ |
21 | - protected $data = []; |
|
21 | + protected $data = [ ]; |
|
22 | 22 | |
23 | 23 | /** @var string */ |
24 | 24 | protected $type; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | protected $writer; |
31 | 31 | |
32 | 32 | /** @var array */ |
33 | - protected $options = []; |
|
33 | + protected $options = [ ]; |
|
34 | 34 | |
35 | 35 | /* ------------------------------------------------------------------------------------------------ |
36 | 36 | | Constructor |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param array $options |
43 | 43 | */ |
44 | - public function __construct(array $options = []) |
|
44 | + public function __construct(array $options = [ ]) |
|
45 | 45 | { |
46 | 46 | $this->setSerializer(new DefaultSerializer); |
47 | 47 | $this->setOptions($options); |
@@ -164,8 +164,9 @@ |
||
164 | 164 | */ |
165 | 165 | protected function makeRows() |
166 | 166 | { |
167 | - if ( ! empty($headerRow = $this->serializer->getHeader())) |
|
168 | - $this->writer->addRow($headerRow); |
|
167 | + if ( ! empty($headerRow = $this->serializer->getHeader())) { |
|
168 | + $this->writer->addRow($headerRow); |
|
169 | + } |
|
169 | 170 | |
170 | 171 | foreach ($this->data as $record) { |
171 | 172 | $this->writer->addRow( |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getDefaultDriver() |
24 | 24 | { |
25 | - return $this->app['config']['laravel-excel.default']; |
|
25 | + return $this->app[ 'config' ][ 'laravel-excel.default' ]; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /* ------------------------------------------------------------------------------------------------ |
@@ -90,6 +90,6 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getDriverOptions($driver) |
92 | 92 | { |
93 | - return $this->app['config']->get("laravel-excel.drivers.$driver.options", []); |
|
93 | + return $this->app[ 'config' ]->get("laravel-excel.drivers.$driver.options", [ ]); |
|
94 | 94 | } |
95 | 95 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | protected $reader; |
34 | 34 | |
35 | 35 | /** @var array */ |
36 | - protected $options = []; |
|
36 | + protected $options = [ ]; |
|
37 | 37 | |
38 | 38 | /* ------------------------------------------------------------------------------------------------ |
39 | 39 | | Constructor |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @param array $options |
46 | 46 | */ |
47 | - public function __construct(array $options = []) |
|
47 | + public function __construct(array $options = [ ]) |
|
48 | 48 | { |
49 | 49 | $this->setParser(new DefaultParser); |
50 | 50 | $this->setOptions($options); |
@@ -197,7 +197,9 @@ |
||
197 | 197 | $rows = Collection::make(); |
198 | 198 | |
199 | 199 | foreach ($this->reader->getSheetIterator() as $index => $sheet) { |
200 | - if ($index !== $this->sheet) continue; |
|
200 | + if ($index !== $this->sheet) { |
|
201 | + continue; |
|
202 | + } |
|
201 | 203 | |
202 | 204 | foreach ($sheet->getRowIterator() as $row) { |
203 | 205 | $rows->push($this->parser->transform($row)); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getDefaultDriver() |
24 | 24 | { |
25 | - return $this->app['config']->get('laravel-excel.default'); |
|
25 | + return $this->app[ 'config' ]->get('laravel-excel.default'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /* ------------------------------------------------------------------------------------------------ |
@@ -90,6 +90,6 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function getDriverOptions($driver) |
92 | 92 | { |
93 | - return $this->app['config']->get("laravel-excel.drivers.$driver.options", []); |
|
93 | + return $this->app[ 'config' ]->get("laravel-excel.drivers.$driver.options", [ ]); |
|
94 | 94 | } |
95 | 95 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | * |
27 | 27 | * @var bool |
28 | 28 | */ |
29 | - protected $defer = true; |
|
29 | + protected $defer = true; |
|
30 | 30 | |
31 | 31 | /* ------------------------------------------------------------------------------------------------ |
32 | 32 | | Getters & Setters |