HighchartsTooltip::setHideDelay()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\Chart;
13
14
use JsonSerializable;
15
use WBW\Library\Core\Utility\Argument\ArrayUtility;
16
17
/**
18
 * Highcharts tooltip.
19
 *
20
 * @author webeweb <https://github.com/webeweb/>
21
 * @package WBW\Bundle\HighchartsBundle\API\Chart
22
 * @version 5.0.14
23
 * @final
24
 */
25
final class HighchartsTooltip implements JsonSerializable {
26
27
    /**
28
     * Animation.
29
     *
30
     * @var boolean
31
     * @since 2.3.0
32
     */
33
    private $animation = true;
34
35
    /**
36
     * Background color.
37
     *
38
     * @var string
39
     */
40
    private $backgroundColor = "rgba(247,247,247,0.85)";
41
42
    /**
43
     * Border color.
44
     *
45
     * @var string
46
     */
47
    private $borderColor;
48
49
    /**
50
     * Border radius.
51
     *
52
     * @var integer
53
     */
54
    private $borderRadius = 3;
55
56
    /**
57
     * Border width.
58
     *
59
     * @var integer
60
     */
61
    private $borderWidth = 1;
62
63
    /**
64
     * Crosshairs.
65
     *
66
     * @var mixed
67
     * @deprecated
68
     */
69
    private $crosshairs;
70
71
    /**
72
     * Date time label formats.
73
     *
74
     * @var array
75
     */
76
    private $dateTimeLabelFormats;
77
78
    /**
79
     * Enabled.
80
     *
81
     * @var boolean
82
     */
83
    private $enabled = true;
84
85
    /**
86
     * Follow pointer.
87
     *
88
     * @var boolean
89
     * @since 3.0
90
     */
91
    private $followPointer = false;
92
93
    /**
94
     * Follow touch move.
95
     *
96
     * @var boolean
97
     * @since 3.0.1
98
     */
99
    private $followTouchMove = true;
100
101
    /**
102
     * Footer format.
103
     *
104
     * @var string
105
     * @since 2.2
106
     */
107
    private $footerFormat = "false";
108
109
    /**
110
     * Formatter.
111
     *
112
     * @var string
113
     */
114
    private $formatter;
115
116
    /**
117
     * Header format.
118
     *
119
     * @var string
120
     */
121
    private $headerFormat;
122
123
    /**
124
     * Hide delay.
125
     *
126
     * @var integer
127
     * @since 3.0
128
     */
129
    private $hideDelay = 500;
130
131
    /**
132
     * Padding.
133
     *
134
     * @var integer
135
     * @since 5.0.0
136
     */
137
    private $padding = 8;
138
139
    /**
140
     * Point format.
141
     *
142
     * @var string
143
     * @since 2.2
144
     */
145
    private $pointFormat = "<span style=\"color:{point.color}\">\\u25CF</span> {series.name}: <b>{point.y}</b><br/>";
146
147
    /**
148
     * Point formatter.
149
     *
150
     * @var string
151
     * @since 4.1.0
152
     */
153
    private $pointFormatter;
154
155
    /**
156
     * Positioner.
157
     *
158
     * @var string
159
     * @since 2.2.4
160
     */
161
    private $positioner;
162
163
    /**
164
     * Shadow.
165
     *
166
     * @var boolean
167
     */
168
    private $shadow = true;
169
170
    /**
171
     * Shape.
172
     *
173
     * @var string
174
     * @since 4.0
175
     */
176
    private $shape = "callout";
177
178
    /**
179
     * Shared.
180
     *
181
     * @var boolean
182
     * @since 2.1
183
     */
184
    private $shared = false;
185
186
    /**
187
     * Snap.
188
     *
189
     * @var integer
190
     * @since 1.2.0
191
     */
192
    private $snap;
193
194
    /**
195
     * Split.
196
     *
197
     * @var boolean
198
     * @since 5.0.0
199
     */
200
    private $split = false;
201
202
    /**
203
     * Style.
204
     *
205
     * @var array
206
     */
207
    private $style = ["color" => "#333333", "cursor" => "default", "fontSize" => "12px", "pointerEvents" => "none", "whiteSpace" => "nowrap"];
208
209
    /**
210
     * Use HTML.
211
     *
212
     * @var boolean
213
     * @since 2.2
214
     */
215
    private $useHTML = false;
216
217
    /**
218
     * Value decimals.
219
     *
220
     * @var integer
221
     * @since 2.2
222
     */
223
    private $valueDecimals;
224
225
    /**
226
     * Value prefix.
227
     *
228
     * @var string
229
     * @since 2.2
230
     */
231
    private $valuePrefix;
232
233
    /**
234
     * Value suffix.
235
     *
236
     * @var string
237
     * @since 2.2
238
     */
239
    private $valueSuffix;
240
241
    /**
242
     * X date format.
243
     *
244
     * @var string
245
     */
246
    private $xDateFormat;
247
248
    /**
249
     * Constructor.
250
     *
251
     * @param boolean $ignoreDefaultValues Ignore the default values.
252
     */
253
    public function __construct($ignoreDefaultValues = true) {
254
        if (true === $ignoreDefaultValues) {
255
            $this->clear();
256
        }
257
    }
258
259
    /**
260
     * Clear.
261
     *
262
     * @return void
263
     */
264
    public function clear() {
265
266
        // Clear the animation.
267
        $this->animation = null;
268
269
        // Clear the background color.
270
        $this->backgroundColor = null;
271
272
        // Clear the border color.
273
        $this->borderColor = null;
274
275
        // Clear the border radius.
276
        $this->borderRadius = null;
277
278
        // Clear the border width.
279
        $this->borderWidth = null;
280
281
        // Clear the crosshairs.
282
        $this->crosshairs = null;
0 ignored issues
show
Deprecated Code introduced by
The property WBW\Bundle\HighchartsBun...rtsTooltip::$crosshairs has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
283
284
        // Clear the date time label formats.
285
        $this->dateTimeLabelFormats = 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 $dateTimeLabelFormats.

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...
286
287
        // Clear the enabled.
288
        $this->enabled = null;
289
290
        // Clear the follow pointer.
291
        $this->followPointer = null;
292
293
        // Clear the follow touch move.
294
        $this->followTouchMove = null;
295
296
        // Clear the footer format.
297
        $this->footerFormat = null;
298
299
        // Clear the formatter.
300
        $this->formatter = null;
301
302
        // Clear the header format.
303
        $this->headerFormat = null;
304
305
        // Clear the hide delay.
306
        $this->hideDelay = null;
307
308
        // Clear the padding.
309
        $this->padding = null;
310
311
        // Clear the point format.
312
        $this->pointFormat = null;
313
314
        // Clear the point formatter.
315
        $this->pointFormatter = null;
316
317
        // Clear the positioner.
318
        $this->positioner = null;
319
320
        // Clear the shadow.
321
        $this->shadow = null;
322
323
        // Clear the shape.
324
        $this->shape = null;
325
326
        // Clear the shared.
327
        $this->shared = null;
328
329
        // Clear the snap.
330
        $this->snap = null;
331
332
        // Clear the split.
333
        $this->split = null;
334
335
        // Clear the style.
336
        $this->style = 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 $style.

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...
337
338
        // Clear the use HTML.
339
        $this->useHTML = null;
340
341
        // Clear the value decimals.
342
        $this->valueDecimals = null;
343
344
        // Clear the value prefix.
345
        $this->valuePrefix = null;
346
347
        // Clear the value suffix.
348
        $this->valueSuffix = null;
349
350
        // Clear the x date format.
351
        $this->xDateFormat = null;
352
    }
353
354
    /**
355
     * Get the animation.
356
     *
357
     * @return boolean Returns the animation.
358
     */
359
    public function getAnimation() {
360
        return $this->animation;
361
    }
362
363
    /**
364
     * Get the background color.
365
     *
366
     * @return string Returns the background color.
367
     */
368
    public function getBackgroundColor() {
369
        return $this->backgroundColor;
370
    }
371
372
    /**
373
     * Get the border color.
374
     *
375
     * @return string Returns the border color.
376
     */
377
    public function getBorderColor() {
378
        return $this->borderColor;
379
    }
380
381
    /**
382
     * Get the border radius.
383
     *
384
     * @return integer Returns the border radius.
385
     */
386
    public function getBorderRadius() {
387
        return $this->borderRadius;
388
    }
389
390
    /**
391
     * Get the border width.
392
     *
393
     * @return integer Returns the border width.
394
     */
395
    public function getBorderWidth() {
396
        return $this->borderWidth;
397
    }
398
399
    /**
400
     * Get the crosshairs.
401
     *
402
     * @return mixed Returns the crosshairs.
403
     * @deprecated
404
     */
405
    public function getCrosshairs() {
406
        return $this->crosshairs;
0 ignored issues
show
Deprecated Code introduced by
The property WBW\Bundle\HighchartsBun...rtsTooltip::$crosshairs has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
407
    }
408
409
    /**
410
     * Get the date time label formats.
411
     *
412
     * @return array Returns the date time label formats.
413
     */
414
    public function getDateTimeLabelFormats() {
415
        return $this->dateTimeLabelFormats;
416
    }
417
418
    /**
419
     * Get the enabled.
420
     *
421
     * @return boolean Returns the enabled.
422
     */
423
    public function getEnabled() {
424
        return $this->enabled;
425
    }
426
427
    /**
428
     * Get the follow pointer.
429
     *
430
     * @return boolean Returns the follow pointer.
431
     */
432
    public function getFollowPointer() {
433
        return $this->followPointer;
434
    }
435
436
    /**
437
     * Get the follow touch move.
438
     *
439
     * @return boolean Returns the follow touch move.
440
     */
441
    public function getFollowTouchMove() {
442
        return $this->followTouchMove;
443
    }
444
445
    /**
446
     * Get the footer format.
447
     *
448
     * @return string Returns the footer format.
449
     */
450
    public function getFooterFormat() {
451
        return $this->footerFormat;
452
    }
453
454
    /**
455
     * Get the formatter.
456
     *
457
     * @return string Returns the formatter.
458
     */
459
    public function getFormatter() {
460
        return $this->formatter;
461
    }
462
463
    /**
464
     * Get the header format.
465
     *
466
     * @return string Returns the header format.
467
     */
468
    public function getHeaderFormat() {
469
        return $this->headerFormat;
470
    }
471
472
    /**
473
     * Get the hide delay.
474
     *
475
     * @return integer Returns the hide delay.
476
     */
477
    public function getHideDelay() {
478
        return $this->hideDelay;
479
    }
480
481
    /**
482
     * Get the padding.
483
     *
484
     * @return integer Returns the padding.
485
     */
486
    public function getPadding() {
487
        return $this->padding;
488
    }
489
490
    /**
491
     * Get the point format.
492
     *
493
     * @return string Returns the point format.
494
     */
495
    public function getPointFormat() {
496
        return $this->pointFormat;
497
    }
498
499
    /**
500
     * Get the point formatter.
501
     *
502
     * @return string Returns the point formatter.
503
     */
504
    public function getPointFormatter() {
505
        return $this->pointFormatter;
506
    }
507
508
    /**
509
     * Get the positioner.
510
     *
511
     * @return string Returns the positioner.
512
     */
513
    public function getPositioner() {
514
        return $this->positioner;
515
    }
516
517
    /**
518
     * Get the shadow.
519
     *
520
     * @return boolean Returns the shadow.
521
     */
522
    public function getShadow() {
523
        return $this->shadow;
524
    }
525
526
    /**
527
     * Get the shape.
528
     *
529
     * @return string Returns the shape.
530
     */
531
    public function getShape() {
532
        return $this->shape;
533
    }
534
535
    /**
536
     * Get the shared.
537
     *
538
     * @return boolean Returns the shared.
539
     */
540
    public function getShared() {
541
        return $this->shared;
542
    }
543
544
    /**
545
     * Get the snap.
546
     *
547
     * @return integer Returns the snap.
548
     */
549
    public function getSnap() {
550
        return $this->snap;
551
    }
552
553
    /**
554
     * Get the split.
555
     *
556
     * @return boolean Returns the split.
557
     */
558
    public function getSplit() {
559
        return $this->split;
560
    }
561
562
    /**
563
     * Get the style.
564
     *
565
     * @return array Returns the style.
566
     */
567
    public function getStyle() {
568
        return $this->style;
569
    }
570
571
    /**
572
     * Get the use HTML.
573
     *
574
     * @return boolean Returns the use HTML.
575
     */
576
    public function getUseHTML() {
577
        return $this->useHTML;
578
    }
579
580
    /**
581
     * Get the value decimals.
582
     *
583
     * @return integer Returns the value decimals.
584
     */
585
    public function getValueDecimals() {
586
        return $this->valueDecimals;
587
    }
588
589
    /**
590
     * Get the value prefix.
591
     *
592
     * @return string Returns the value prefix.
593
     */
594
    public function getValuePrefix() {
595
        return $this->valuePrefix;
596
    }
597
598
    /**
599
     * Get the value suffix.
600
     *
601
     * @return string Returns the value suffix.
602
     */
603
    public function getValueSuffix() {
604
        return $this->valueSuffix;
605
    }
606
607
    /**
608
     * Get the x date format.
609
     *
610
     * @return string Returns the x date format.
611
     */
612
    public function getXDateFormat() {
613
        return $this->xDateFormat;
614
    }
615
616
    /**
617
     * Serialize this instance.
618
     *
619
     * @return array Returns an array representing this instance.
620
     */
621
    public function jsonSerialize() {
622
        return $this->toArray();
623
    }
624
625
    /**
626
     * Set the animation.
627
     *
628
     * @param boolean $animation The animation.
629
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
630
     */
631
    public function setAnimation($animation) {
632
        $this->animation = $animation;
633
        return $this;
634
    }
635
636
    /**
637
     * Set the background color.
638
     *
639
     * @param string $backgroundColor The background color.
640
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
641
     */
642
    public function setBackgroundColor($backgroundColor) {
643
        $this->backgroundColor = $backgroundColor;
644
        return $this;
645
    }
646
647
    /**
648
     * Set the border color.
649
     *
650
     * @param string $borderColor The border color.
651
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
652
     */
653
    public function setBorderColor($borderColor) {
654
        $this->borderColor = $borderColor;
655
        return $this;
656
    }
657
658
    /**
659
     * Set the border radius.
660
     *
661
     * @param integer $borderRadius The border radius.
662
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
663
     */
664
    public function setBorderRadius($borderRadius) {
665
        $this->borderRadius = $borderRadius;
666
        return $this;
667
    }
668
669
    /**
670
     * Set the border width.
671
     *
672
     * @param integer $borderWidth The border width.
673
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
674
     */
675
    public function setBorderWidth($borderWidth) {
676
        $this->borderWidth = $borderWidth;
677
        return $this;
678
    }
679
680
    /**
681
     * Set the crosshairs.
682
     *
683
     * @param mixed $crosshairs The crosshairs.
684
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
685
     * @deprecated
686
     */
687
    public function setCrosshairs($crosshairs) {
688
        $this->crosshairs = $crosshairs;
0 ignored issues
show
Deprecated Code introduced by
The property WBW\Bundle\HighchartsBun...rtsTooltip::$crosshairs has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
689
        return $this;
690
    }
691
692
    /**
693
     * Set the date time label formats.
694
     *
695
     * @param array $dateTimeLabelFormats The date time label formats.
696
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
697
     */
698
    public function setDateTimeLabelFormats(array $dateTimeLabelFormats = null) {
699
        $this->dateTimeLabelFormats = $dateTimeLabelFormats;
0 ignored issues
show
Documentation Bug introduced by
It seems like $dateTimeLabelFormats can be null. However, the property $dateTimeLabelFormats 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...
700
        return $this;
701
    }
702
703
    /**
704
     * Set the enabled.
705
     *
706
     * @param boolean $enabled The enabled.
707
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
708
     */
709
    public function setEnabled($enabled) {
710
        $this->enabled = $enabled;
711
        return $this;
712
    }
713
714
    /**
715
     * Set the follow pointer.
716
     *
717
     * @param boolean $followPointer The follow pointer.
718
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
719
     */
720
    public function setFollowPointer($followPointer) {
721
        $this->followPointer = $followPointer;
722
        return $this;
723
    }
724
725
    /**
726
     * Set the follow touch move.
727
     *
728
     * @param boolean $followTouchMove The follow touch move.
729
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
730
     */
731
    public function setFollowTouchMove($followTouchMove) {
732
        $this->followTouchMove = $followTouchMove;
733
        return $this;
734
    }
735
736
    /**
737
     * Set the footer format.
738
     *
739
     * @param string $footerFormat The footer format.
740
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
741
     */
742
    public function setFooterFormat($footerFormat) {
743
        $this->footerFormat = $footerFormat;
744
        return $this;
745
    }
746
747
    /**
748
     * Set the formatter.
749
     *
750
     * @param string $formatter The formatter.
751
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
752
     */
753
    public function setFormatter($formatter) {
754
        $this->formatter = $formatter;
755
        return $this;
756
    }
757
758
    /**
759
     * Set the header format.
760
     *
761
     * @param string $headerFormat The header format.
762
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
763
     */
764
    public function setHeaderFormat($headerFormat) {
765
        $this->headerFormat = $headerFormat;
766
        return $this;
767
    }
768
769
    /**
770
     * Set the hide delay.
771
     *
772
     * @param integer $hideDelay The hide delay.
773
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
774
     */
775
    public function setHideDelay($hideDelay) {
776
        $this->hideDelay = $hideDelay;
777
        return $this;
778
    }
779
780
    /**
781
     * Set the padding.
782
     *
783
     * @param integer $padding The padding.
784
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
785
     */
786
    public function setPadding($padding) {
787
        $this->padding = $padding;
788
        return $this;
789
    }
790
791
    /**
792
     * Set the point format.
793
     *
794
     * @param string $pointFormat The point format.
795
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
796
     */
797
    public function setPointFormat($pointFormat) {
798
        $this->pointFormat = $pointFormat;
799
        return $this;
800
    }
801
802
    /**
803
     * Set the point formatter.
804
     *
805
     * @param string $pointFormatter The point formatter.
806
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
807
     */
808
    public function setPointFormatter($pointFormatter) {
809
        $this->pointFormatter = $pointFormatter;
810
        return $this;
811
    }
812
813
    /**
814
     * Set the positioner.
815
     *
816
     * @param string $positioner The positioner.
817
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
818
     */
819
    public function setPositioner($positioner) {
820
        $this->positioner = $positioner;
821
        return $this;
822
    }
823
824
    /**
825
     * Set the shadow.
826
     *
827
     * @param boolean $shadow The shadow.
828
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
829
     */
830
    public function setShadow($shadow) {
831
        $this->shadow = $shadow;
832
        return $this;
833
    }
834
835
    /**
836
     * Set the shape.
837
     *
838
     * @param string $shape The shape.
839
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
840
     */
841
    public function setShape($shape) {
842
        $this->shape = $shape;
843
        return $this;
844
    }
845
846
    /**
847
     * Set the shared.
848
     *
849
     * @param boolean $shared The shared.
850
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
851
     */
852
    public function setShared($shared) {
853
        $this->shared = $shared;
854
        return $this;
855
    }
856
857
    /**
858
     * Set the snap.
859
     *
860
     * @param integer $snap The snap.
861
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
862
     */
863
    public function setSnap($snap) {
864
        $this->snap = $snap;
865
        return $this;
866
    }
867
868
    /**
869
     * Set the split.
870
     *
871
     * @param boolean $split The split.
872
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
873
     */
874
    public function setSplit($split) {
875
        $this->split = $split;
876
        return $this;
877
    }
878
879
    /**
880
     * Set the style.
881
     *
882
     * @param array $style The style.
883
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
884
     */
885
    public function setStyle(array $style = null) {
886
        $this->style = $style;
0 ignored issues
show
Documentation Bug introduced by
It seems like $style can be null. However, the property $style 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...
887
        return $this;
888
    }
889
890
    /**
891
     * Set the use HTML.
892
     *
893
     * @param boolean $useHTML The use HTML.
894
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
895
     */
896
    public function setUseHTML($useHTML) {
897
        $this->useHTML = $useHTML;
898
        return $this;
899
    }
900
901
    /**
902
     * Set the value decimals.
903
     *
904
     * @param integer $valueDecimals The value decimals.
905
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
906
     */
907
    public function setValueDecimals($valueDecimals) {
908
        $this->valueDecimals = $valueDecimals;
909
        return $this;
910
    }
911
912
    /**
913
     * Set the value prefix.
914
     *
915
     * @param string $valuePrefix The value prefix.
916
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
917
     */
918
    public function setValuePrefix($valuePrefix) {
919
        $this->valuePrefix = $valuePrefix;
920
        return $this;
921
    }
922
923
    /**
924
     * Set the value suffix.
925
     *
926
     * @param string $valueSuffix The value suffix.
927
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
928
     */
929
    public function setValueSuffix($valueSuffix) {
930
        $this->valueSuffix = $valueSuffix;
931
        return $this;
932
    }
933
934
    /**
935
     * Set the x date format.
936
     *
937
     * @param string $xDateFormat The x date format.
938
     * @return \WBW\Bundle\HighchartsBundle\API\Chart\HighchartsTooltip Returns the highcharts tooltip.
939
     */
940
    public function setXDateFormat($xDateFormat) {
941
        $this->xDateFormat = $xDateFormat;
942
        return $this;
943
    }
944
945
    /**
946
     * Convert into an array representing this instance.
947
     *
948
     * @return array Returns an array representing this instance.
949
     */
950
    public function toArray() {
951
952
        // Initialize the output.
953
        $output = [];
954
955
        // Set the animation.
956
        ArrayUtility::set($output, "animation", $this->animation, [null]);
957
958
        // Set the background color.
959
        ArrayUtility::set($output, "backgroundColor", $this->backgroundColor, [null]);
960
961
        // Set the border color.
962
        ArrayUtility::set($output, "borderColor", $this->borderColor, [null]);
963
964
        // Set the border radius.
965
        ArrayUtility::set($output, "borderRadius", $this->borderRadius, [null]);
966
967
        // Set the border width.
968
        ArrayUtility::set($output, "borderWidth", $this->borderWidth, [null]);
969
970
        // Set the crosshairs.
971
        ArrayUtility::set($output, "crosshairs", $this->crosshairs, [null]);
0 ignored issues
show
Deprecated Code introduced by
The property WBW\Bundle\HighchartsBun...rtsTooltip::$crosshairs has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
972
973
        // Set the date time label formats.
974
        ArrayUtility::set($output, "dateTimeLabelFormats", $this->dateTimeLabelFormats, [null]);
975
976
        // Set the enabled.
977
        ArrayUtility::set($output, "enabled", $this->enabled, [null]);
978
979
        // Set the follow pointer.
980
        ArrayUtility::set($output, "followPointer", $this->followPointer, [null]);
981
982
        // Set the follow touch move.
983
        ArrayUtility::set($output, "followTouchMove", $this->followTouchMove, [null]);
984
985
        // Set the footer format.
986
        ArrayUtility::set($output, "footerFormat", $this->footerFormat, [null]);
987
988
        // Set the formatter.
989
        ArrayUtility::set($output, "formatter", $this->formatter, [null]);
990
991
        // Set the header format.
992
        ArrayUtility::set($output, "headerFormat", $this->headerFormat, [null]);
993
994
        // Set the hide delay.
995
        ArrayUtility::set($output, "hideDelay", $this->hideDelay, [null]);
996
997
        // Set the padding.
998
        ArrayUtility::set($output, "padding", $this->padding, [null]);
999
1000
        // Set the point format.
1001
        ArrayUtility::set($output, "pointFormat", $this->pointFormat, [null]);
1002
1003
        // Set the point formatter.
1004
        ArrayUtility::set($output, "pointFormatter", $this->pointFormatter, [null]);
1005
1006
        // Set the positioner.
1007
        ArrayUtility::set($output, "positioner", $this->positioner, [null]);
1008
1009
        // Set the shadow.
1010
        ArrayUtility::set($output, "shadow", $this->shadow, [null]);
1011
1012
        // Set the shape.
1013
        ArrayUtility::set($output, "shape", $this->shape, [null]);
1014
1015
        // Set the shared.
1016
        ArrayUtility::set($output, "shared", $this->shared, [null]);
1017
1018
        // Set the snap.
1019
        ArrayUtility::set($output, "snap", $this->snap, [null]);
1020
1021
        // Set the split.
1022
        ArrayUtility::set($output, "split", $this->split, [null]);
1023
1024
        // Set the style.
1025
        ArrayUtility::set($output, "style", $this->style, [null]);
1026
1027
        // Set the use HTML.
1028
        ArrayUtility::set($output, "useHTML", $this->useHTML, [null]);
1029
1030
        // Set the value decimals.
1031
        ArrayUtility::set($output, "valueDecimals", $this->valueDecimals, [null]);
1032
1033
        // Set the value prefix.
1034
        ArrayUtility::set($output, "valuePrefix", $this->valuePrefix, [null]);
1035
1036
        // Set the value suffix.
1037
        ArrayUtility::set($output, "valueSuffix", $this->valueSuffix, [null]);
1038
1039
        // Set the x date format.
1040
        ArrayUtility::set($output, "xDateFormat", $this->xDateFormat, [null]);
1041
1042
        // Return the output.
1043
        return $output;
1044
    }
1045
1046
}
1047