1 | <?php namespace Arcanedev\LaravelExcel\Exporters; |
||
14 | abstract class AbstractExporter implements ExporterContract |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Properties |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** @var array */ |
||
21 | protected $data = []; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $type; |
||
25 | |||
26 | /** @var \Arcanedev\LaravelExcel\Contracts\Serializer */ |
||
27 | protected $serializer; |
||
28 | |||
29 | /** @var \Box\Spout\Writer\WriterInterface */ |
||
30 | protected $writer; |
||
31 | |||
32 | /** @var array */ |
||
33 | protected $options = []; |
||
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Constructor |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * AbstractExporter constructor. |
||
41 | * |
||
42 | * @param array $options |
||
43 | */ |
||
44 | 18 | public function __construct(array $options = []) |
|
49 | |||
50 | /* ------------------------------------------------------------------------------------------------ |
||
51 | | Getters & Setters |
||
52 | | ------------------------------------------------------------------------------------------------ |
||
53 | */ |
||
54 | /** |
||
55 | * Set the serializer. |
||
56 | * |
||
57 | * @param \Arcanedev\LaravelExcel\Contracts\Serializer $serializer |
||
58 | * |
||
59 | * @return self |
||
60 | */ |
||
61 | 18 | public function setSerializer(SerializerContract $serializer) |
|
67 | |||
68 | /** |
||
69 | * Get the file type. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | 18 | public function getType() |
|
77 | |||
78 | /** |
||
79 | * Set the writer options. |
||
80 | * |
||
81 | * @param array $options |
||
82 | * |
||
83 | * @return self |
||
84 | */ |
||
85 | 18 | public function setOptions(array $options) |
|
91 | |||
92 | /* ------------------------------------------------------------------------------------------------ |
||
93 | | Main Functions |
||
94 | | ------------------------------------------------------------------------------------------------ |
||
95 | */ |
||
96 | /** |
||
97 | * Load the data. |
||
98 | * |
||
99 | * @param Collection $data |
||
100 | * |
||
101 | * @return self |
||
102 | */ |
||
103 | public function load(Collection $data) |
||
109 | |||
110 | /** |
||
111 | * Save the data to a file. |
||
112 | * |
||
113 | * @param string $filename |
||
114 | */ |
||
115 | public function save($filename) |
||
122 | |||
123 | /** |
||
124 | * Output data directly to the browser. |
||
125 | * |
||
126 | * @param string $filename |
||
127 | */ |
||
128 | public function stream($filename) |
||
135 | |||
136 | /* ------------------------------------------------------------------------------------------------ |
||
137 | | Other Functions |
||
138 | | ------------------------------------------------------------------------------------------------ |
||
139 | */ |
||
140 | /** |
||
141 | * Create the writer. |
||
142 | */ |
||
143 | protected function create() |
||
148 | |||
149 | /** |
||
150 | * Load the writer options. |
||
151 | */ |
||
152 | abstract protected function loadOptions(); |
||
153 | |||
154 | /** |
||
155 | * Close the writer. |
||
156 | */ |
||
157 | protected function close() |
||
161 | |||
162 | /** |
||
163 | * Make rows. |
||
164 | */ |
||
165 | protected function makeRows() |
||
176 | } |
||
177 |
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..