HighchartsChart   F
last analyzed

Complexity

Total Complexity 102

Size/Duplication

Total Lines 1050
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 18

Importance

Changes 0
Metric Value
wmc 102
lcom 1
cbo 18
dl 0
loc 1050
rs 1.4
c 0
b 0
f 0

67 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
F clear() 0 105 18
A getAccessibility() 0 3 1
A getChart() 0 3 1
A getColors() 0 3 1
A getCredits() 0 3 1
A getData() 0 3 1
A getDefs() 0 3 1
A getDrilldown() 0 3 1
A getExporting() 0 3 1
A getLabels() 0 3 1
A getLegend() 0 3 1
A getLoading() 0 3 1
A getNavigation() 0 3 1
A getNoData() 0 3 1
A getPane() 0 3 1
A getPlotOptions() 0 3 1
A getResponsive() 0 3 1
A getSeries() 0 3 1
A getSubtitle() 0 3 1
A getTitle() 0 3 1
A getTooltip() 0 3 1
A getXAxis() 0 3 1
A getYAxis() 0 3 1
A getZAxis() 0 3 1
A jsonSerialize() 0 3 1
A newAccessibility() 0 4 1
A newChart() 0 4 1
A newCredits() 0 4 1
A newData() 0 4 1
A newDrilldown() 0 4 1
A newExporting() 0 4 1
A newLabels() 0 4 1
A newLegend() 0 4 1
A newLoading() 0 4 1
A newNavigation() 0 4 1
A newNoData() 0 4 1
A newPlotOptions() 0 4 1
A newResponsive() 0 4 1
A newSubtitle() 0 4 1
A newTitle() 0 4 1
A newTooltip() 0 4 1
A newZAxis() 0 4 1
A setAccessibility() 0 4 1
A setChart() 0 4 1
A setColors() 0 4 1
A setCredits() 0 4 1
A setData() 0 4 1
A setDefs() 0 4 1
A setDrilldown() 0 4 1
A setExporting() 0 4 1
A setLabels() 0 4 1
A setLegend() 0 4 1
A setLoading() 0 4 1
A setNavigation() 0 4 1
A setNoData() 0 4 1
A setPane() 0 4 1
A setPlotOptions() 0 4 1
A setResponsive() 0 4 1
A setSeries() 0 4 1
A setSubtitle() 0 4 1
A setTitle() 0 4 1
A setTooltip() 0 4 1
A setXAxis() 0 4 1
A setYAxis() 0 4 1
A setZAxis() 0 4 1
F toArray() 0 111 18

How to fix   Complexity   

Complex Class

Complex classes like HighchartsChart often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use HighchartsChart, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
/**
4
 * This file is part of the highcharts-bundle package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\HighchartsBundle\API;
13
14
use JsonSerializable;
15
use WBW\Library\Core\Utility\Argument\ArrayUtility;
16
17
/**
18
 * Highcharts chart.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Bundle\HighchartsBundle\API
22
 * @version 5.0.14
23
 * @final
24
 */
25
final class HighchartsChart implements JsonSerializable {
26
27
    /**
28
     * Accessibility.
29
     *
30
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility
31
     * @since 5.0.0
32
     */
33
    private $accessibility;
34
35
    /**
36
     * Chart.
37
     *
38
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart
39
     */
40
    private $chart;
41
42
    /**
43
     * Colors.
44
     *
45
     * @var array
46
     */
47
    private $colors = ["#7cb5ec", "#434348", "#90ed7d", "#f7a35c", "#8085e9", "#f15c80", "#e4d354", "#2b908f", "#f45b5b", "#91e8e1"];
48
49
    /**
50
     * Credits.
51
     *
52
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits
53
     */
54
    private $credits;
55
56
    /**
57
     * Data.
58
     *
59
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData
60
     * @since 4.0
61
     */
62
    private $data;
63
64
    /**
65
     * Defs.
66
     *
67
     * @var array
68
     * @since 5.0.0
69
     */
70
    private $defs;
71
72
    /**
73
     * Drilldown.
74
     *
75
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown
76
     * @since 3.0.8
77
     */
78
    private $drilldown;
79
80
    /**
81
     * Exporting.
82
     *
83
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting
84
     */
85
    private $exporting;
86
87
    /**
88
     * Labels.
89
     *
90
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels
91
     */
92
    private $labels;
93
94
    /**
95
     * Legend.
96
     *
97
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend
98
     */
99
    private $legend;
100
101
    /**
102
     * Loading.
103
     *
104
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading
105
     */
106
    private $loading;
107
108
    /**
109
     * Navigation.
110
     *
111
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation
112
     */
113
    private $navigation;
114
115
    /**
116
     * No data.
117
     *
118
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData
119
     * @since 3.0.8
120
     */
121
    private $noData;
122
123
    /**
124
     * Pane.
125
     *
126
     * @var array
127
     * @since 2.3.0
128
     */
129
    private $pane;
130
131
    /**
132
     * Plot options.
133
     *
134
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions
135
     */
136
    private $plotOptions;
137
138
    /**
139
     * Responsive.
140
     *
141
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive
142
     * @since 5.0.0
143
     */
144
    private $responsive;
145
146
    /**
147
     * Series.
148
     *
149
     * @var array
150
     */
151
    private $series;
152
153
    /**
154
     * Subtitle.
155
     *
156
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle
157
     */
158
    private $subtitle;
159
160
    /**
161
     * Title.
162
     *
163
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle
164
     */
165
    private $title;
166
167
    /**
168
     * Tooltip.
169
     *
170
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip
171
     */
172
    private $tooltip;
173
174
    /**
175
     * X axis.
176
     *
177
     * @var array
178
     */
179
    private $xAxis;
180
181
    /**
182
     * Y axis.
183
     *
184
     * @var array
185
     */
186
    private $yAxis;
187
188
    /**
189
     * Z axis.
190
     *
191
     * @var \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis
192
     * @since 5.0.0
193
     */
194
    private $zAxis;
195
196
    /**
197
     * Constructor.
198
     *
199
     * @param boolean $ignoreDefaultValues Ignore the default values.
200
     */
201
    public function __construct($ignoreDefaultValues = true) {
202
        if (true === $ignoreDefaultValues) {
203
            $this->clear();
204
        }
205
    }
206
207
    /**
208
     * Clear.
209
     *
210
     * @return void
211
     */
212
    public function clear() {
213
214
        // Clear the accessibility.
215
        if (null !== $this->accessibility) {
216
            $this->accessibility->clear();
217
        }
218
219
        // Clear the chart.
220
        if (null !== $this->chart) {
221
            $this->chart->clear();
222
        }
223
224
        // Clear the colors.
225
        $this->colors = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $colors.

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..

Loading history...
226
227
        // Clear the credits.
228
        if (null !== $this->credits) {
229
            $this->credits->clear();
230
        }
231
232
        // Clear the data.
233
        if (null !== $this->data) {
234
            $this->data->clear();
235
        }
236
237
        // Clear the defs.
238
        $this->defs = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $defs.

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..

Loading history...
239
240
        // Clear the drilldown.
241
        if (null !== $this->drilldown) {
242
            $this->drilldown->clear();
243
        }
244
245
        // Clear the exporting.
246
        if (null !== $this->exporting) {
247
            $this->exporting->clear();
248
        }
249
250
        // Clear the labels.
251
        if (null !== $this->labels) {
252
            $this->labels->clear();
253
        }
254
255
        // Clear the legend.
256
        if (null !== $this->legend) {
257
            $this->legend->clear();
258
        }
259
260
        // Clear the loading.
261
        if (null !== $this->loading) {
262
            $this->loading->clear();
263
        }
264
265
        // Clear the navigation.
266
        if (null !== $this->navigation) {
267
            $this->navigation->clear();
268
        }
269
270
        // Clear the no data.
271
        if (null !== $this->noData) {
272
            $this->noData->clear();
273
        }
274
275
        // Clear the pane.
276
        $this->pane = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $pane.

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..

Loading history...
277
278
        // Clear the plot options.
279
        if (null !== $this->plotOptions) {
280
            $this->plotOptions->clear();
281
        }
282
283
        // Clear the responsive.
284
        if (null !== $this->responsive) {
285
            $this->responsive->clear();
286
        }
287
288
        // Clear the series.
289
        $this->series = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $series.

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..

Loading history...
290
291
        // Clear the subtitle.
292
        if (null !== $this->subtitle) {
293
            $this->subtitle->clear();
294
        }
295
296
        // Clear the title.
297
        if (null !== $this->title) {
298
            $this->title->clear();
299
        }
300
301
        // Clear the tooltip.
302
        if (null !== $this->tooltip) {
303
            $this->tooltip->clear();
304
        }
305
306
        // Clear the x axis.
307
        $this->xAxis = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $xAxis.

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..

Loading history...
308
309
        // Clear the y axis.
310
        $this->yAxis = null;
0 ignored issues
show
Documentation Bug introduced by
It seems like null of type null is incompatible with the declared type array of property $yAxis.

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..

Loading history...
311
312
        // Clear the z axis.
313
        if (null !== $this->zAxis) {
314
            $this->zAxis->clear();
315
        }
316
    }
317
318
    /**
319
     * Get the accessibility.
320
     *
321
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility Returns the accessibility.
322
     */
323
    public function getAccessibility() {
324
        return $this->accessibility;
325
    }
326
327
    /**
328
     * Get the chart.
329
     *
330
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart Returns the chart.
331
     */
332
    public function getChart() {
333
        return $this->chart;
334
    }
335
336
    /**
337
     * Get the colors.
338
     *
339
     * @return array Returns the colors.
340
     */
341
    public function getColors() {
342
        return $this->colors;
343
    }
344
345
    /**
346
     * Get the credits.
347
     *
348
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits Returns the credits.
349
     */
350
    public function getCredits() {
351
        return $this->credits;
352
    }
353
354
    /**
355
     * Get the data.
356
     *
357
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData Returns the data.
358
     */
359
    public function getData() {
360
        return $this->data;
361
    }
362
363
    /**
364
     * Get the defs.
365
     *
366
     * @return array Returns the defs.
367
     */
368
    public function getDefs() {
369
        return $this->defs;
370
    }
371
372
    /**
373
     * Get the drilldown.
374
     *
375
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown Returns the drilldown.
376
     */
377
    public function getDrilldown() {
378
        return $this->drilldown;
379
    }
380
381
    /**
382
     * Get the exporting.
383
     *
384
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting Returns the exporting.
385
     */
386
    public function getExporting() {
387
        return $this->exporting;
388
    }
389
390
    /**
391
     * Get the labels.
392
     *
393
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels Returns the labels.
394
     */
395
    public function getLabels() {
396
        return $this->labels;
397
    }
398
399
    /**
400
     * Get the legend.
401
     *
402
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend Returns the legend.
403
     */
404
    public function getLegend() {
405
        return $this->legend;
406
    }
407
408
    /**
409
     * Get the loading.
410
     *
411
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the loading.
412
     */
413
    public function getLoading() {
414
        return $this->loading;
415
    }
416
417
    /**
418
     * Get the navigation.
419
     *
420
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the navigation.
421
     */
422
    public function getNavigation() {
423
        return $this->navigation;
424
    }
425
426
    /**
427
     * Get the no data.
428
     *
429
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the no data.
430
     */
431
    public function getNoData() {
432
        return $this->noData;
433
    }
434
435
    /**
436
     * Get the pane.
437
     *
438
     * @return array Returns the pane.
439
     */
440
    public function getPane() {
441
        return $this->pane;
442
    }
443
444
    /**
445
     * Get the plot options.
446
     *
447
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions Returns the plot options.
448
     */
449
    public function getPlotOptions() {
450
        return $this->plotOptions;
451
    }
452
453
    /**
454
     * Get the responsive.
455
     *
456
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive Returns the responsive.
457
     */
458
    public function getResponsive() {
459
        return $this->responsive;
460
    }
461
462
    /**
463
     * Get the series.
464
     *
465
     * @return array Returns the series.
466
     */
467
    public function getSeries() {
468
        return $this->series;
469
    }
470
471
    /**
472
     * Get the subtitle.
473
     *
474
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle Returns the subtitle.
475
     */
476
    public function getSubtitle() {
477
        return $this->subtitle;
478
    }
479
480
    /**
481
     * Get the title.
482
     *
483
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle Returns the title.
484
     */
485
    public function getTitle() {
486
        return $this->title;
487
    }
488
489
    /**
490
     * Get the tooltip.
491
     *
492
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the tooltip.
493
     */
494
    public function getTooltip() {
495
        return $this->tooltip;
496
    }
497
498
    /**
499
     * Get the x axis.
500
     *
501
     * @return array Returns the x axis.
502
     */
503
    public function getXAxis() {
504
        return $this->xAxis;
505
    }
506
507
    /**
508
     * Get the y axis.
509
     *
510
     * @return array Returns the y axis.
511
     */
512
    public function getYAxis() {
513
        return $this->yAxis;
514
    }
515
516
    /**
517
     * Get the z axis.
518
     *
519
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis Returns the z axis.
520
     */
521
    public function getZAxis() {
522
        return $this->zAxis;
523
    }
524
525
    /**
526
     * Serialize this instance.
527
     *
528
     * @return array Returns an array representing this instance.
529
     */
530
    public function jsonSerialize() {
531
        return $this->toArray();
532
    }
533
534
    /**
535
     * Create a new accessibility.
536
     *
537
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility Returns the accessibility.
538
     */
539
    public function newAccessibility() {
540
        $this->accessibility = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility();
541
        return $this->accessibility;
542
    }
543
544
    /**
545
     * Create a new chart.
546
     *
547
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart Returns the chart.
548
     */
549
    public function newChart() {
550
        $this->chart = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart();
551
        return $this->chart;
552
    }
553
554
    /**
555
     * Create a new credits.
556
     *
557
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits Returns the credits.
558
     */
559
    public function newCredits() {
560
        $this->credits = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits();
561
        return $this->credits;
562
    }
563
564
    /**
565
     * Create a new data.
566
     *
567
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData Returns the data.
568
     */
569
    public function newData() {
570
        $this->data = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData();
571
        return $this->data;
572
    }
573
574
    /**
575
     * Create a new drilldown.
576
     *
577
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown Returns the drilldown.
578
     */
579
    public function newDrilldown() {
580
        $this->drilldown = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown();
581
        return $this->drilldown;
582
    }
583
584
    /**
585
     * Create a new exporting.
586
     *
587
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting Returns the exporting.
588
     */
589
    public function newExporting() {
590
        $this->exporting = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting();
591
        return $this->exporting;
592
    }
593
594
    /**
595
     * Create a new labels.
596
     *
597
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels Returns the labels.
598
     */
599
    public function newLabels() {
600
        $this->labels = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels();
601
        return $this->labels;
602
    }
603
604
    /**
605
     * Create a new legend.
606
     *
607
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend Returns the legend.
608
     */
609
    public function newLegend() {
610
        $this->legend = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend();
611
        return $this->legend;
612
    }
613
614
    /**
615
     * Create a new loading.
616
     *
617
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading Returns the loading.
618
     */
619
    public function newLoading() {
620
        $this->loading = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading();
621
        return $this->loading;
622
    }
623
624
    /**
625
     * Create a new navigation.
626
     *
627
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation Returns the navigation.
628
     */
629
    public function newNavigation() {
630
        $this->navigation = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation();
631
        return $this->navigation;
632
    }
633
634
    /**
635
     * Create a new no data.
636
     *
637
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData Returns the no data.
638
     */
639
    public function newNoData() {
640
        $this->noData = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData();
641
        return $this->noData;
642
    }
643
644
    /**
645
     * Create a new plot options.
646
     *
647
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions Returns the plot options.
648
     */
649
    public function newPlotOptions() {
650
        $this->plotOptions = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions();
651
        return $this->plotOptions;
652
    }
653
654
    /**
655
     * Create a new responsive.
656
     *
657
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive Returns the responsive.
658
     */
659
    public function newResponsive() {
660
        $this->responsive = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive();
661
        return $this->responsive;
662
    }
663
664
    /**
665
     * Create a new subtitle.
666
     *
667
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle Returns the subtitle.
668
     */
669
    public function newSubtitle() {
670
        $this->subtitle = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle();
671
        return $this->subtitle;
672
    }
673
674
    /**
675
     * Create a new title.
676
     *
677
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle Returns the title.
678
     */
679
    public function newTitle() {
680
        $this->title = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle();
681
        return $this->title;
682
    }
683
684
    /**
685
     * Create a new tooltip.
686
     *
687
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the tooltip.
688
     */
689
    public function newTooltip() {
690
        $this->tooltip = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip();
691
        return $this->tooltip;
692
    }
693
694
    /**
695
     * Create a new z axis.
696
     *
697
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis Returns the z axis.
698
     */
699
    public function newZAxis() {
700
        $this->zAxis = new \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis();
701
        return $this->zAxis;
702
    }
703
704
    /**
705
     * Set the accessibility.
706
     *
707
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility $accessibility The accessibility.
708
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
709
     */
710
    public function setAccessibility(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsAccessibility $accessibility = null) {
711
        $this->accessibility = $accessibility;
712
        return $this;
713
    }
714
715
    /**
716
     * Set the chart.
717
     *
718
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart $chart The chart.
719
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
720
     */
721
    public function setChart(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsChart $chart = null) {
722
        $this->chart = $chart;
723
        return $this;
724
    }
725
726
    /**
727
     * Set the colors.
728
     *
729
     * @param array $colors The colors.
730
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
731
     */
732
    public function setColors(array $colors = null) {
733
        $this->colors = $colors;
0 ignored issues
show
Documentation Bug introduced by
It seems like $colors can be null. However, the property $colors is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
734
        return $this;
735
    }
736
737
    /**
738
     * Set the credits.
739
     *
740
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits $credits The credits.
741
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
742
     */
743
    public function setCredits(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsCredits $credits = null) {
744
        $this->credits = $credits;
745
        return $this;
746
    }
747
748
    /**
749
     * Set the data.
750
     *
751
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData $data The data.
752
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
753
     */
754
    public function setData(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsData $data = null) {
755
        $this->data = $data;
756
        return $this;
757
    }
758
759
    /**
760
     * Set the defs.
761
     *
762
     * @param array $defs The defs.
763
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
764
     */
765
    public function setDefs(array $defs = null) {
766
        $this->defs = $defs;
0 ignored issues
show
Documentation Bug introduced by
It seems like $defs can be null. However, the property $defs is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
767
        return $this;
768
    }
769
770
    /**
771
     * Set the drilldown.
772
     *
773
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown $drilldown The drilldown.
774
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
775
     */
776
    public function setDrilldown(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsDrilldown $drilldown = null) {
777
        $this->drilldown = $drilldown;
778
        return $this;
779
    }
780
781
    /**
782
     * Set the exporting.
783
     *
784
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting $exporting The exporting.
785
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
786
     */
787
    public function setExporting(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsExporting $exporting = null) {
788
        $this->exporting = $exporting;
789
        return $this;
790
    }
791
792
    /**
793
     * Set the labels.
794
     *
795
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels $labels The labels.
796
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
797
     */
798
    public function setLabels(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLabels $labels = null) {
799
        $this->labels = $labels;
800
        return $this;
801
    }
802
803
    /**
804
     * Set the legend.
805
     *
806
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend $legend The legend.
807
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
808
     */
809
    public function setLegend(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLegend $legend = null) {
810
        $this->legend = $legend;
811
        return $this;
812
    }
813
814
    /**
815
     * Set the loading.
816
     *
817
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading $loading The loading.
818
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
819
     */
820
    public function setLoading(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsLoading $loading = null) {
821
        $this->loading = $loading;
822
        return $this;
823
    }
824
825
    /**
826
     * Set the navigation.
827
     *
828
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation $navigation The navigation.
829
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
830
     */
831
    public function setNavigation(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNavigation $navigation = null) {
832
        $this->navigation = $navigation;
833
        return $this;
834
    }
835
836
    /**
837
     * Set the no data.
838
     *
839
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData $noData The no data.
840
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
841
     */
842
    public function setNoData(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsNoData $noData = null) {
843
        $this->noData = $noData;
844
        return $this;
845
    }
846
847
    /**
848
     * Set the pane.
849
     *
850
     * @param array $pane The pane.
851
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
852
     */
853
    public function setPane(array $pane = null) {
854
        $this->pane = $pane;
0 ignored issues
show
Documentation Bug introduced by
It seems like $pane can be null. However, the property $pane is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
855
        return $this;
856
    }
857
858
    /**
859
     * Set the plot options.
860
     *
861
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions $plotOptions The plot options.
862
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
863
     */
864
    public function setPlotOptions(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsPlotOptions $plotOptions = null) {
865
        $this->plotOptions = $plotOptions;
866
        return $this;
867
    }
868
869
    /**
870
     * Set the responsive.
871
     *
872
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive $responsive The responsive.
873
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
874
     */
875
    public function setResponsive(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsResponsive $responsive = null) {
876
        $this->responsive = $responsive;
877
        return $this;
878
    }
879
880
    /**
881
     * Set the series.
882
     *
883
     * @param array $series The series.
884
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
885
     */
886
    public function setSeries(array $series = null) {
887
        $this->series = $series;
0 ignored issues
show
Documentation Bug introduced by
It seems like $series can be null. However, the property $series is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
888
        return $this;
889
    }
890
891
    /**
892
     * Set the subtitle.
893
     *
894
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle $subtitle The subtitle.
895
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
896
     */
897
    public function setSubtitle(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsSubtitle $subtitle = null) {
898
        $this->subtitle = $subtitle;
899
        return $this;
900
    }
901
902
    /**
903
     * Set the title.
904
     *
905
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle $title The title.
906
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
907
     */
908
    public function setTitle(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTitle $title = null) {
909
        $this->title = $title;
910
        return $this;
911
    }
912
913
    /**
914
     * Set the tooltip.
915
     *
916
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip $tooltip The tooltip.
917
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
918
     */
919
    public function setTooltip(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip $tooltip = null) {
920
        $this->tooltip = $tooltip;
921
        return $this;
922
    }
923
924
    /**
925
     * Set the x axis.
926
     *
927
     * @param array $xAxis The x axis.
928
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
929
     */
930
    public function setXAxis(array $xAxis = null) {
931
        $this->xAxis = $xAxis;
0 ignored issues
show
Documentation Bug introduced by
It seems like $xAxis can be null. However, the property $xAxis is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
932
        return $this;
933
    }
934
935
    /**
936
     * Set the y axis.
937
     *
938
     * @param array $yAxis The y axis.
939
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
940
     */
941
    public function setYAxis(array $yAxis = null) {
942
        $this->yAxis = $yAxis;
0 ignored issues
show
Documentation Bug introduced by
It seems like $yAxis can be null. However, the property $yAxis is declared as array. Maybe change the type of the property to array|null or add a type check?

Our type inference engine has found an assignment of a scalar value (like a string, an integer or null) to a property which is an array.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property.

To type hint that a parameter can be either an array or null, you can set a type hint of array and a default value of null. The PHP interpreter will then accept both an array or null for that parameter.

function aContainsB(array $needle = null, array  $haystack) {
    if (!$needle) {
        return false;
    }

    return array_intersect($haystack, $needle) == $haystack;
}

The function can be called with either null or an array for the parameter $needle but will only accept an array as $haystack.

Loading history...
943
        return $this;
944
    }
945
946
    /**
947
     * Set the z axis.
948
     *
949
     * @param \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis $zAxis The z axis.
950
     * @return \WBW\Bundle\HighchartsBundle\API\HighchartsChart Returns the highcharts chart.
951
     */
952
    public function setZAxis(\WBW\Bundle\HighchartsBundle\API\Chart\HighchartsZAxis $zAxis = null) {
953
        $this->zAxis = $zAxis;
954
        return $this;
955
    }
956
957
    /**
958
     * Convert into an array representing this instance.
959
     *
960
     * @return array Returns an array representing this instance.
961
     */
962
    public function toArray() {
963
964
        // Initialize the output.
965
        $output = [];
966
967
        // Set the accessibility.
968
        if (null !== $this->accessibility) {
969
            ArrayUtility::set($output, "accessibility", $this->accessibility->toArray(), []);
970
        }
971
972
        // Set the chart.
973
        if (null !== $this->chart) {
974
            ArrayUtility::set($output, "chart", $this->chart->toArray(), []);
975
        }
976
977
        // Set the colors.
978
        ArrayUtility::set($output, "colors", $this->colors, [null]);
979
980
        // Set the credits.
981
        if (null !== $this->credits) {
982
            ArrayUtility::set($output, "credits", $this->credits->toArray(), []);
983
        }
984
985
        // Set the data.
986
        if (null !== $this->data) {
987
            ArrayUtility::set($output, "data", $this->data->toArray(), []);
988
        }
989
990
        // Set the defs.
991
        ArrayUtility::set($output, "defs", $this->defs, [null]);
992
993
        // Set the drilldown.
994
        if (null !== $this->drilldown) {
995
            ArrayUtility::set($output, "drilldown", $this->drilldown->toArray(), []);
996
        }
997
998
        // Set the exporting.
999
        if (null !== $this->exporting) {
1000
            ArrayUtility::set($output, "exporting", $this->exporting->toArray(), []);
1001
        }
1002
1003
        // Set the labels.
1004
        if (null !== $this->labels) {
1005
            ArrayUtility::set($output, "labels", $this->labels->toArray(), []);
1006
        }
1007
1008
        // Set the legend.
1009
        if (null !== $this->legend) {
1010
            ArrayUtility::set($output, "legend", $this->legend->toArray(), []);
1011
        }
1012
1013
        // Set the loading.
1014
        if (null !== $this->loading) {
1015
            ArrayUtility::set($output, "loading", $this->loading->toArray(), []);
1016
        }
1017
1018
        // Set the navigation.
1019
        if (null !== $this->navigation) {
1020
            ArrayUtility::set($output, "navigation", $this->navigation->toArray(), []);
1021
        }
1022
1023
        // Set the no data.
1024
        if (null !== $this->noData) {
1025
            ArrayUtility::set($output, "noData", $this->noData->toArray(), []);
1026
        }
1027
1028
        // Set the pane.
1029
        ArrayUtility::set($output, "pane", $this->pane, [null]);
1030
1031
        // Set the plot options.
1032
        if (null !== $this->plotOptions) {
1033
            ArrayUtility::set($output, "plotOptions", $this->plotOptions->toArray(), []);
1034
        }
1035
1036
        // Set the responsive.
1037
        if (null !== $this->responsive) {
1038
            ArrayUtility::set($output, "responsive", $this->responsive->toArray(), []);
1039
        }
1040
1041
        // Set the series.
1042
        ArrayUtility::set($output, "series", $this->series, [null]);
1043
1044
        // Set the subtitle.
1045
        if (null !== $this->subtitle) {
1046
            ArrayUtility::set($output, "subtitle", $this->subtitle->toArray(), []);
1047
        }
1048
1049
        // Set the title.
1050
        if (null !== $this->title) {
1051
            ArrayUtility::set($output, "title", $this->title->toArray(), []);
1052
        }
1053
1054
        // Set the tooltip.
1055
        if (null !== $this->tooltip) {
1056
            ArrayUtility::set($output, "tooltip", $this->tooltip->toArray(), []);
1057
        }
1058
1059
        // Set the x axis.
1060
        ArrayUtility::set($output, "xAxis", $this->xAxis, [null]);
1061
1062
        // Set the y axis.
1063
        ArrayUtility::set($output, "yAxis", $this->yAxis, [null]);
1064
1065
        // Set the z axis.
1066
        if (null !== $this->zAxis) {
1067
            ArrayUtility::set($output, "zAxis", $this->zAxis->toArray(), []);
1068
        }
1069
1070
        // Return the output.
1071
        return $output;
1072
    }
1073
1074
}
1075