1 | <?php |
||
27 | class DataSeriesValues |
||
28 | { |
||
29 | const DATASERIES_TYPE_STRING = 'String'; |
||
30 | const DATASERIES_TYPE_NUMBER = 'Number'; |
||
31 | |||
32 | private static $dataTypeValues = [ |
||
33 | self::DATASERIES_TYPE_STRING, |
||
34 | self::DATASERIES_TYPE_NUMBER, |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * Series Data Type. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | private $dataType; |
||
43 | |||
44 | /** |
||
45 | * Series Data Source. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | private $dataSource; |
||
50 | |||
51 | /** |
||
52 | * Format Code. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | private $formatCode; |
||
57 | |||
58 | /** |
||
59 | * Series Point Marker. |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | private $pointMarker; |
||
64 | |||
65 | /** |
||
66 | * Point Count (The number of datapoints in the dataseries). |
||
67 | * |
||
68 | * @var int |
||
69 | */ |
||
70 | private $pointCount = 0; |
||
71 | |||
72 | /** |
||
73 | * Data Values. |
||
74 | * |
||
75 | * @var array of mixed |
||
76 | */ |
||
77 | private $dataValues = []; |
||
78 | |||
79 | /** |
||
80 | * Create a new DataSeriesValues object. |
||
81 | * |
||
82 | * @param mixed $dataType |
||
83 | * @param string $dataSource |
||
84 | * @param null|mixed $formatCode |
||
85 | * @param mixed $pointCount |
||
86 | * @param mixed $dataValues |
||
87 | * @param null|mixed $marker |
||
88 | */ |
||
89 | 17 | public function __construct($dataType = self::DATASERIES_TYPE_NUMBER, $dataSource = null, $formatCode = null, $pointCount = 0, $dataValues = [], $marker = null) |
|
98 | |||
99 | /** |
||
100 | * Get Series Data Type. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | 1 | public function getDataType() |
|
108 | |||
109 | /** |
||
110 | * Set Series Data Type. |
||
111 | * |
||
112 | * @param string $dataType Datatype of this data series |
||
113 | * Typical values are: |
||
114 | * \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_STRING |
||
115 | * Normally used for axis point values |
||
116 | * \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues::DATASERIES_TYPE_NUMBER |
||
117 | * Normally used for chart data values |
||
118 | * |
||
119 | * @throws Exception |
||
120 | * |
||
121 | * @return DataSeriesValues |
||
122 | */ |
||
123 | 17 | public function setDataType($dataType) |
|
132 | |||
133 | /** |
||
134 | * Get Series Data Source (formula). |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | 13 | public function getDataSource() |
|
142 | |||
143 | /** |
||
144 | * Set Series Data Source (formula). |
||
145 | * |
||
146 | * @param string $dataSource |
||
147 | * |
||
148 | * @return DataSeriesValues |
||
149 | */ |
||
150 | public function setDataSource($dataSource) |
||
156 | |||
157 | /** |
||
158 | * Get Point Marker. |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | 13 | public function getPointMarker() |
|
166 | |||
167 | /** |
||
168 | * Set Point Marker. |
||
169 | * |
||
170 | * @param string $marker |
||
171 | * |
||
172 | * @return DataSeriesValues |
||
173 | */ |
||
174 | public function setPointMarker($marker) |
||
180 | |||
181 | /** |
||
182 | * Get Series Format Code. |
||
183 | * |
||
184 | * @return string |
||
185 | */ |
||
186 | 12 | public function getFormatCode() |
|
190 | |||
191 | /** |
||
192 | * Set Series Format Code. |
||
193 | * |
||
194 | * @param string $formatCode |
||
195 | * |
||
196 | * @return DataSeriesValues |
||
197 | */ |
||
198 | public function setFormatCode($formatCode) |
||
204 | |||
205 | /** |
||
206 | * Get Series Point Count. |
||
207 | * |
||
208 | * @return int |
||
209 | */ |
||
210 | 13 | public function getPointCount() |
|
214 | |||
215 | /** |
||
216 | * Identify if the Data Series is a multi-level or a simple series. |
||
217 | * |
||
218 | * @return bool|null |
||
219 | */ |
||
220 | 13 | public function isMultiLevelSeries() |
|
228 | |||
229 | /** |
||
230 | * Return the level count of a multi-level Data Series. |
||
231 | * |
||
232 | * @return int |
||
233 | */ |
||
234 | 2 | public function multiLevelCount() |
|
243 | |||
244 | /** |
||
245 | * Get Series Data Values. |
||
246 | * |
||
247 | * @return array of mixed |
||
248 | */ |
||
249 | 13 | public function getDataValues() |
|
253 | |||
254 | /** |
||
255 | * Get the first Series Data value. |
||
256 | * |
||
257 | * @return mixed |
||
258 | */ |
||
259 | public function getDataValue() |
||
270 | |||
271 | /** |
||
272 | * Set Series Data Values. |
||
273 | * |
||
274 | * @param array $dataValues |
||
275 | * |
||
276 | * @return DataSeriesValues |
||
277 | */ |
||
278 | public function setDataValues($dataValues) |
||
285 | |||
286 | 13 | public function refresh(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet, $flatten = true) |
|
332 | } |
||
333 |
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..