1 | <?php |
||
28 | trait ConverterTrait |
||
29 | { |
||
30 | use ValidatorTrait; |
||
31 | |||
32 | /** |
||
33 | * Charset Encoding for the CSV |
||
34 | * |
||
35 | * This information is used when converting the CSV to XML or JSON |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $input_encoding = 'UTF-8'; |
||
40 | |||
41 | /** |
||
42 | * Sets the CSV encoding charset |
||
43 | * |
||
44 | * @param string $input_encoding |
||
45 | * |
||
46 | * @throws InvalidArgumentException if the charset is empty |
||
47 | * |
||
48 | * @return static |
||
49 | */ |
||
50 | 6 | public function inputEncoding(string $input_encoding): self |
|
58 | |||
59 | /** |
||
60 | * Convert Csv file into UTF-8 |
||
61 | * |
||
62 | * @param array|Traversable $records the CSV records collection |
||
63 | * |
||
64 | * @return array|Iterator |
||
65 | */ |
||
66 | 8 | protected function convertToUtf8($records) |
|
84 | } |
||
85 |