Completed
Push — master ( 0e1003...1276c7 )
by Abdelrahman
61:46 queued 59:06
created

DefaultImporterHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Importers;
6
7
use Maatwebsite\Excel\Files\ExcelFile;
8
use Maatwebsite\Excel\Collections\CellCollection;
9
10
class DefaultImporterHandler
11
{
12
    public function handle(ExcelFile $importer)
13
    {
14
        $importer->each(function (CellCollection $row) use ($importer) {
15
            app('cortex.foundation.import_record')->create([
16
                'resource' => app($importer->config['resource'])->getMorphClass(),
0 ignored issues
show
Bug introduced by
The property config does not seem to exist in Maatwebsite\Excel\Files\ExcelFile.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
17
                'data' => $row,
18
            ]);
19
        });
20
    }
21
}
22