1 | <?php |
||
16 | class CsvConfiguration implements CsvConfigurationInterface |
||
17 | { |
||
18 | const DEFAULT_DELIMITER = ','; |
||
19 | const DEFAULT_NULL = '\\N'; |
||
20 | const DEFAULT_QUOTE = '"'; |
||
21 | const DEFAULT_ESCAPE = '\\'; |
||
22 | const DEFAULT_DOUBLE_QUOTE = false; |
||
23 | const DEFAULT_ENCODING = 'UTF-8'; |
||
24 | |||
25 | const OPTION_DELIMITER = 'delimiter'; |
||
26 | const OPTION_NULL = 'null'; |
||
27 | const OPTION_NEW_LINES = 'newLines'; |
||
28 | const OPTION_QUOTE = 'quote'; |
||
29 | const OPTION_ESCAPE = 'escape'; |
||
30 | const OPTION_DOUBLE_QUOTE = 'doubleQuote'; |
||
31 | const OPTION_BOMS = 'boms'; |
||
32 | const OPTION_ENCODING = 'encoding'; |
||
33 | |||
34 | /** @var string */ |
||
35 | private $delimiter; |
||
36 | /** @var string */ |
||
37 | private $quote; |
||
38 | /** @var string */ |
||
39 | private $escape; |
||
40 | /** @var bool */ |
||
41 | private $doubleQuotes; |
||
42 | /** @var string[] */ |
||
43 | private $newLines; |
||
44 | /** @var string */ |
||
45 | private $null; |
||
46 | /** @var string[] */ |
||
47 | private $boms; |
||
48 | /** @var string */ |
||
49 | private $encoding; |
||
50 | |||
51 | /** |
||
52 | * CsvConfiguration constructor. |
||
53 | * |
||
54 | * @param array $options List of options that can be configured: |
||
55 | * <p> `delimiter` string (Default: `','`) |
||
56 | * <p> `quote` string (Default: `'"'`) |
||
57 | * <p> `escape` string (Default: `'\\'`) |
||
58 | * <p> `doubleQuotes` string (Default: `false`) |
||
59 | * <p> `newLines` string[] (Default: `["\n","\r","\r\n"]`) |
||
60 | * <p> `null` string (Default: `'\\N'`) |
||
61 | * <p> `boms` string[] (Default: |
||
62 | * `[Bom::BOM_UTF8,Bom::BOM_UTF16_BE,Bom::BOM_UTF16_LE,Bom::BOM_UTF32_BE,Bom::BOM_UTF32_LE]`) |
||
63 | * <p> `encoding` string (Default: `'UTF-8'`) |
||
64 | */ |
||
65 | 6 | public function __construct(array $options = []) |
|
82 | |||
83 | /** |
||
84 | * @param array $options |
||
85 | * @param string $name |
||
86 | * @param mixed $default |
||
87 | * |
||
88 | * @return mixed |
||
89 | */ |
||
90 | 6 | private function getOption(array $options, $name, $default = null) |
|
98 | |||
99 | /** |
||
100 | * @return string |
||
101 | */ |
||
102 | 30 | public function getDelimiter() |
|
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | 30 | public function getQuote() |
|
114 | |||
115 | /** |
||
116 | * @return string |
||
117 | */ |
||
118 | 30 | public function getEscape() |
|
122 | |||
123 | /** |
||
124 | * @return string[] |
||
125 | */ |
||
126 | 30 | public function getNewLines() |
|
130 | |||
131 | /** |
||
132 | * @return bool |
||
133 | */ |
||
134 | 28 | public function useDoubleQuotes() |
|
138 | |||
139 | /** |
||
140 | * @return string |
||
141 | */ |
||
142 | 30 | public function getNullValue() |
|
146 | |||
147 | /** |
||
148 | * @return string[] |
||
149 | */ |
||
150 | 30 | public function getBoms() |
|
154 | |||
155 | /** |
||
156 | * @return string |
||
157 | */ |
||
158 | 30 | public function getEncoding() |
|
162 | } |
||
163 |
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..