1 | <?php |
||
16 | class Reader extends ReaderAbstract |
||
17 | { |
||
18 | /** @var resource Pointer to the file to be written */ |
||
19 | protected $filePointer; |
||
20 | |||
21 | /** @var SheetIterator To iterator over the CSV unique "sheet" */ |
||
22 | protected $sheetIterator; |
||
23 | |||
24 | /** @var string Original value for the "auto_detect_line_endings" INI value */ |
||
25 | protected $originalAutoDetectLineEndings; |
||
26 | |||
27 | /** |
||
28 | * Sets the field delimiter for the CSV. |
||
29 | * Needs to be called before opening the reader. |
||
30 | * |
||
31 | * @param string $fieldDelimiter Character that delimits fields |
||
32 | * @return Reader |
||
33 | */ |
||
34 | 19 | public function setFieldDelimiter($fieldDelimiter) |
|
39 | |||
40 | /** |
||
41 | * Sets the field enclosure for the CSV. |
||
42 | * Needs to be called before opening the reader. |
||
43 | * |
||
44 | * @param string $fieldEnclosure Character that enclose fields |
||
45 | * @return Reader |
||
46 | */ |
||
47 | 19 | public function setFieldEnclosure($fieldEnclosure) |
|
52 | |||
53 | /** |
||
54 | * Sets the encoding of the CSV file to be read. |
||
55 | * Needs to be called before opening the reader. |
||
56 | * |
||
57 | * @param string $encoding Encoding of the CSV file to be read |
||
58 | * @return Reader |
||
59 | */ |
||
60 | 23 | public function setEncoding($encoding) |
|
65 | |||
66 | /** |
||
67 | * Returns whether stream wrappers are supported |
||
68 | * |
||
69 | * @return bool |
||
70 | */ |
||
71 | 2 | protected function doesSupportStreamWrapper() |
|
75 | |||
76 | /** |
||
77 | * Opens the file at the given path to make it ready to be read. |
||
78 | * If setEncoding() was not called, it assumes that the file is encoded in UTF-8. |
||
79 | * |
||
80 | * @param string $filePath Path of the CSV file to be read |
||
81 | * @return void |
||
82 | * @throws \Box\Spout\Common\Exception\IOException |
||
83 | */ |
||
84 | 27 | protected function openReader($filePath) |
|
103 | |||
104 | /** |
||
105 | * Returns an iterator to iterate over sheets. |
||
106 | * |
||
107 | * @return SheetIterator To iterate over sheets |
||
108 | */ |
||
109 | 26 | protected function getConcreteSheetIterator() |
|
113 | |||
114 | |||
115 | /** |
||
116 | * Closes the reader. To be used after reading the file. |
||
117 | * |
||
118 | * @return void |
||
119 | */ |
||
120 | 26 | protected function closeReader() |
|
128 | } |
||
129 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: