Passed
Push — master ( 831269...80f51c )
by Stephen
02:10 queued 12s
created

CollectionExcelExport   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A collection() 0 3 1
1
<?php
2
3
namespace Sfneal\ViewExport\Excel\Exports;
4
5
use Illuminate\Support\Collection;
6
use Maatwebsite\Excel\Concerns\FromCollection;
7
use Sfneal\ViewExport\Support\ExcelExport;
8
9
class CollectionExcelExport extends ExcelExport implements FromCollection
10
{
11
    /**
12
     * @var Collection
13
     */
14
    private $collection;
15
16
    /**
17
     * CollectionExcelExport constructor.
18
     *
19
     * @param Collection $collection
20
     */
21
    public function __construct(Collection $collection)
22
    {
23
        $this->collection = $collection;
24
    }
25
26
    /**
27
     * Retrieve the Collection.
28
     *
29
     * @return Collection
30
     */
31
    public function collection(): Collection
32
    {
33
        return $this->collection;
34
    }
35
}
36