1 | <?php namespace Arcanedev\LaravelExcel\Exporters; |
||
14 | abstract class AbstractExporter implements ExporterContract |
||
15 | { |
||
16 | /* ----------------------------------------------------------------- |
||
17 | | Properties |
||
18 | | ----------------------------------------------------------------- |
||
19 | */ |
||
20 | |||
21 | /** @var array */ |
||
22 | protected $data = []; |
||
23 | |||
24 | /** @var string */ |
||
25 | protected $type; |
||
26 | |||
27 | /** @var \Arcanedev\LaravelExcel\Contracts\Serializer */ |
||
28 | protected $serializer; |
||
29 | |||
30 | /** @var \Box\Spout\Writer\WriterInterface */ |
||
31 | protected $writer; |
||
32 | |||
33 | /** @var array */ |
||
34 | protected $options = []; |
||
35 | |||
36 | /* ----------------------------------------------------------------- |
||
37 | | Constructor |
||
38 | | ----------------------------------------------------------------- |
||
39 | */ |
||
40 | |||
41 | /** |
||
42 | * AbstractExporter constructor. |
||
43 | * |
||
44 | * @param array $options |
||
45 | */ |
||
46 | 27 | public function __construct(array $options = []) |
|
51 | |||
52 | /* ----------------------------------------------------------------- |
||
53 | | Getters & Setters |
||
54 | | ----------------------------------------------------------------- |
||
55 | */ |
||
56 | |||
57 | /** |
||
58 | * Set the serializer. |
||
59 | * |
||
60 | * @param \Arcanedev\LaravelExcel\Contracts\Serializer $serializer |
||
61 | * |
||
62 | * @return self |
||
63 | */ |
||
64 | 27 | public function setSerializer(SerializerContract $serializer) |
|
70 | |||
71 | /** |
||
72 | * Get the file type. |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | 18 | public function getType() |
|
80 | |||
81 | /** |
||
82 | * Set the writer options. |
||
83 | * |
||
84 | * @param array $options |
||
85 | * |
||
86 | * @return self |
||
87 | */ |
||
88 | 27 | public function setOptions(array $options) |
|
94 | |||
95 | /* ----------------------------------------------------------------- |
||
96 | | Main Methods |
||
97 | | ----------------------------------------------------------------- |
||
98 | */ |
||
99 | |||
100 | /** |
||
101 | * Load the data. |
||
102 | * |
||
103 | * @param \Illuminate\Support\Collection $data |
||
104 | * |
||
105 | * @return self |
||
106 | */ |
||
107 | 9 | public function load(Collection $data) |
|
113 | |||
114 | /** |
||
115 | * Save the data to a file. |
||
116 | * |
||
117 | * @param string $filename |
||
118 | */ |
||
119 | 9 | public function save($filename) |
|
126 | |||
127 | /* ----------------------------------------------------------------- |
||
128 | | Other Methods |
||
129 | | ----------------------------------------------------------------- |
||
130 | */ |
||
131 | |||
132 | /** |
||
133 | * Create the writer. |
||
134 | */ |
||
135 | 9 | protected function create() |
|
140 | |||
141 | /** |
||
142 | * Load the writer options. |
||
143 | */ |
||
144 | abstract protected function loadOptions(); |
||
145 | |||
146 | /** |
||
147 | * Close the writer. |
||
148 | */ |
||
149 | 9 | protected function close() |
|
153 | |||
154 | /** |
||
155 | * Make rows. |
||
156 | */ |
||
157 | 9 | protected function makeRows() |
|
168 | } |
||
169 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..