1 | <?php |
||
16 | class CsvConfiguration implements CsvConfigurationInterface |
||
17 | { |
||
18 | const DEFAULT_DELIMITER = ','; |
||
19 | const DEFAULT_NULL = '\\N'; |
||
20 | const DEFAULT_NEW_LINES = ["\n", "\r", "\r\n"]; |
||
21 | const DEFAULT_QUOTE = '"'; |
||
22 | const DEFAULT_ESCAPE = '\\'; |
||
23 | const DEFAULT_DOUBLE_QUOTE = false; |
||
24 | const DEFAULT_BOMS = [ |
||
25 | Bom::BOM_UTF8, |
||
26 | Bom::BOM_UTF16_BE, |
||
27 | Bom::BOM_UTF16_LE, |
||
28 | Bom::BOM_UTF32_BE, |
||
29 | Bom::BOM_UTF32_LE, |
||
30 | ]; |
||
31 | const DEFAULT_ENCODING = 'UTF-8'; |
||
32 | |||
33 | const OPTION_DELIMITER = 'delimiter'; |
||
34 | const OPTION_NULL = 'null'; |
||
35 | const OPTION_NEW_LINES = 'newLines'; |
||
36 | const OPTION_QUOTE = 'quote'; |
||
37 | const OPTION_ESCAPE = 'escape'; |
||
38 | const OPTION_DOUBLE_QUOTE = 'doubleQuote'; |
||
39 | const OPTION_BOMS = 'boms'; |
||
40 | const OPTION_ENCODING = 'encoding'; |
||
41 | |||
42 | /** @var string */ |
||
43 | private $delimiter; |
||
44 | /** @var string */ |
||
45 | private $quote; |
||
46 | /** @var string */ |
||
47 | private $escape; |
||
48 | /** @var bool */ |
||
49 | private $doubleQuotes; |
||
50 | /** @var string[] */ |
||
51 | private $newLines; |
||
52 | /** @var string */ |
||
53 | private $null; |
||
54 | /** @var string[] */ |
||
55 | private $boms; |
||
56 | /** @var string */ |
||
57 | private $encoding; |
||
58 | |||
59 | /** |
||
60 | * CsvConfiguration constructor. |
||
61 | * |
||
62 | * @param array $options List of options that can be configured: |
||
63 | * <p> `delimiter` string (Default: `','`) |
||
64 | * <p> `quote` string (Default: `'"'`) |
||
65 | * <p> `escape` string (Default: `'\\'`) |
||
66 | * <p> `doubleQuotes` string (Default: `false`) |
||
67 | * <p> `newLines` string[] (Default: `["\n","\r","\r\n"]`) |
||
68 | * <p> `null` string (Default: `'\\N'`) |
||
69 | * <p> `boms` string[] (Default: |
||
70 | * `[Bom::BOM_UTF8,Bom::BOM_UTF16_BE,Bom::BOM_UTF16_LE,Bom::BOM_UTF32_BE,Bom::BOM_UTF32_LE]`) |
||
71 | * <p> `encoding` string (Default: `'UTF-8'`) |
||
72 | */ |
||
73 | 6 | public function __construct(array $options = []) |
|
84 | |||
85 | /** |
||
86 | * @param array $options |
||
87 | * @param string $name |
||
88 | * @param mixed $default |
||
89 | * |
||
90 | * @return mixed |
||
91 | */ |
||
92 | 6 | private function getOption(array $options, $name, $default = null) |
|
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | 30 | public function getDelimiter() |
|
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | 30 | public function getQuote() |
|
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | 30 | public function getEscape() |
|
124 | |||
125 | /** |
||
126 | * @return string[] |
||
127 | */ |
||
128 | 30 | public function getNewLines() |
|
132 | |||
133 | /** |
||
134 | * @return bool |
||
135 | */ |
||
136 | 28 | public function useDoubleQuotes() |
|
140 | |||
141 | /** |
||
142 | * @return string |
||
143 | */ |
||
144 | 30 | public function getNullValue() |
|
148 | |||
149 | /** |
||
150 | * @return string[] |
||
151 | */ |
||
152 | 30 | public function getBoms() |
|
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | 30 | public function getEncoding() |
|
164 | } |
||
165 |
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..