Skip to content

Commit a3274a6

Browse files
authored
Merge pull request #6 from Konafets/feature/MakeImporterFluent
Make the Importer fluent
2 parents 7939f48 + 0189f49 commit a3274a6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ $collection = $excel->getCollection();
151151

152152
The importer class is fluent, then you can also write
153153
```
154-
return Importer::make('Excel')->getCollection($filepath)->getCollection();
154+
return Importer::make('Excel')->load($filepath)->getCollection();
155155
```
156156

157157
### Advanced usage

src/Importer/AbstractSpreadsheet.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ public function __call($name, $args)
3737
public function load($path)
3838
{
3939
$this->path = $path;
40+
return $this;
4041
}
4142

4243
public function setSheet($sheet)
4344
{
4445
$this->sheet = $sheet;
46+
return $this;
4547
}
4648

4749
public function hasHeader($hasHeaderRow)
@@ -52,11 +54,13 @@ public function hasHeader($hasHeaderRow)
5254
public function setParser(ParserInterface $parser)
5355
{
5456
$this->parser = $parser;
57+
return $this;
5558
}
5659

5760
public function setModel(Model $model)
5861
{
5962
$this->model = $model;
63+
return $this;
6064
}
6165

6266
abstract public function getType();

0 commit comments

Comments
 (0)