1 | <?php |
||
7 | class CsvExporter extends AbstractExporter |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $filename; |
||
13 | |||
14 | /** |
||
15 | * @var \Closure |
||
16 | */ |
||
17 | protected $callback; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $exceptColumns; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $onlyColumns; |
||
28 | |||
29 | /** |
||
30 | * @var []\Closure |
||
31 | */ |
||
32 | protected $columnCallbacks; |
||
33 | |||
34 | /** |
||
35 | * @var []\Closure |
||
36 | */ |
||
37 | protected $titleCallbacks; |
||
38 | |||
39 | /** |
||
40 | * @var array |
||
41 | */ |
||
42 | protected $visibleColumns; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | protected $columnUseOriginalValue; |
||
48 | |||
49 | /** |
||
50 | * @param string $filename |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function filename(string $filename = ''): self |
||
60 | |||
61 | /** |
||
62 | * @param \Closure $closure |
||
63 | */ |
||
64 | public function setCallback(\Closure $closure): self |
||
70 | |||
71 | /** |
||
72 | * @param array $columns |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function except(array $columns = []): self |
||
82 | |||
83 | /** |
||
84 | * @param array $columns |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function only(array $columns = []): self |
||
94 | |||
95 | /** |
||
96 | * @param array $columns |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function originalValue($columns = []): self |
||
106 | |||
107 | /** |
||
108 | * @param string $name |
||
109 | * @param \Closure $callback |
||
110 | * |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function column(string $name, \Closure $callback): self |
||
119 | |||
120 | /** |
||
121 | * @param string $name |
||
122 | * @param \Closure $callback |
||
123 | * |
||
124 | * @return $this |
||
125 | */ |
||
126 | public function title(string $name, \Closure $callback): self |
||
132 | |||
133 | /** |
||
134 | * Get download response headers. |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | protected function getHeaders() |
||
150 | |||
151 | /** |
||
152 | * {@inheritdoc} |
||
153 | */ |
||
154 | public function export() |
||
191 | |||
192 | /** |
||
193 | * @return array |
||
194 | */ |
||
195 | protected function getVisiableTitles() |
||
220 | |||
221 | /** |
||
222 | * @param array $value |
||
223 | * @param array $original |
||
224 | * |
||
225 | * @return array |
||
226 | */ |
||
227 | public function getVisiableFields(array $value, array $original): array |
||
241 | |||
242 | /** |
||
243 | * @param string $column |
||
244 | * @param mixed $value |
||
245 | * @param mixed $original |
||
246 | * |
||
247 | * @return mixed |
||
248 | */ |
||
249 | protected function getColumnValue(string $column, $value, $original) |
||
262 | } |
||
263 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: