1 | <?php |
||
12 | class CsvExporter extends AbstractExporter |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $filename; |
||
18 | |||
19 | /** |
||
20 | * @var \Closure |
||
21 | */ |
||
22 | protected $callback; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $exceptColumns; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $onlyColumns; |
||
33 | |||
34 | /** |
||
35 | * @var []\Closure |
||
36 | */ |
||
37 | protected $columnCallbacks; |
||
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 | * @return $this |
||
52 | */ |
||
53 | public function filename(string $filename = ''): self |
||
59 | |||
60 | /** |
||
61 | * @param \Closure $closure |
||
62 | */ |
||
63 | public function setCallback(\Closure $closure): self |
||
69 | |||
70 | /** |
||
71 | * @param array $columns |
||
72 | * @return $this |
||
73 | */ |
||
74 | public function except(array $columns = []): self |
||
80 | |||
81 | /** |
||
82 | * @param array $columns |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function only(array $columns = []): self |
||
91 | |||
92 | /** |
||
93 | * @param array $columns |
||
94 | * @return $this |
||
95 | */ |
||
96 | public function originalValue($columns = []): self |
||
102 | |||
103 | /** |
||
104 | * @param string $name |
||
105 | * @param \Closure $callback |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function column(string $name, \Closure $callback): self |
||
114 | |||
115 | /** |
||
116 | * Get download response headers. |
||
117 | * |
||
118 | * @return array |
||
119 | */ |
||
120 | protected function getHeaders() |
||
132 | |||
133 | /** |
||
134 | * {@inheritdoc} |
||
135 | */ |
||
136 | public function export() |
||
174 | |||
175 | /** |
||
176 | * @return array |
||
177 | */ |
||
178 | protected function getVisiableTitles() |
||
197 | |||
198 | /** |
||
199 | * @param array $value |
||
200 | * @param array $original |
||
201 | * @return array |
||
202 | */ |
||
203 | public function getVisiableFields(array $value, array $original): array |
||
217 | |||
218 | /** |
||
219 | * @param string $column |
||
220 | * @param mixed $value |
||
221 | * @param mixed $original |
||
222 | * @return mixed |
||
223 | */ |
||
224 | protected function getColumnValue(string $column, $value, $original) |
||
237 | } |
||
238 |
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: