@@ -109,10 +109,12 @@ abstract class Properties
109
109
110
110
protected ChartColor $ glowColor ;
111
111
112
+ /** @var array{size: ?float} */
112
113
protected array $ softEdges = [
113
114
'size ' => null ,
114
115
];
115
116
117
+ /** @var mixed[] */
116
118
protected array $ shadowProperties = self ::PRESETS_OPTIONS [0 ];
117
119
118
120
protected ChartColor $ shadowColor ;
@@ -395,13 +397,17 @@ protected function setColorProperties(?string $color, null|float|int|string $alp
395
397
],
396
398
];
397
399
400
+ /** @return mixed[] */
398
401
protected function getShadowPresetsMap (int $ presetsOption ): array
399
402
{
400
403
return self ::PRESETS_OPTIONS [$ presetsOption ] ?? self ::PRESETS_OPTIONS [0 ];
401
404
}
402
405
403
406
/**
404
407
* Get value of array element.
408
+ *
409
+ * @param mixed[] $properties
410
+ * @param array<mixed>|int|string $elements
405
411
*/
406
412
protected function getArrayElementsValue (array $ properties , array |int |string $ elements ): mixed
407
413
{
@@ -411,7 +417,7 @@ protected function getArrayElementsValue(array $properties, array|int|string $el
411
417
}
412
418
413
419
foreach ($ elements as $ keys ) {
414
- $ reference = &$ reference [$ keys ];
420
+ $ reference = &$ reference [$ keys ]; //* @phpstan-ignore-line
415
421
}
416
422
417
423
return $ reference ;
@@ -436,6 +442,10 @@ public function setGlowProperties(float $size, ?string $colorValue = null, ?int
436
442
437
443
/**
438
444
* Get Glow Property.
445
+ *
446
+ * @param mixed[]|string $property
447
+ *
448
+ * @return null|array<mixed>|float|int|string
439
449
*/
440
450
public function getGlowProperty (array |string $ property ): null |array |float |int |string
441
451
{
@@ -449,7 +459,9 @@ public function getGlowProperty(array|string $property): null|array|float|int|st
449
459
'alpha ' => $ this ->glowColor ->getColorProperty ('alpha ' ),
450
460
];
451
461
} elseif (is_array ($ property ) && count ($ property ) >= 2 && $ property [0 ] === 'color ' ) {
452
- $ retVal = $ this ->glowColor ->getColorProperty ($ property [1 ]);
462
+ /** @var string */
463
+ $ temp = $ property [1 ];
464
+ $ retVal = $ this ->glowColor ->getColorProperty ($ temp );
453
465
}
454
466
455
467
return $ retVal ;
@@ -566,6 +578,9 @@ protected function setShadowPresetsProperties(int $presets)
566
578
/**
567
579
* Set Shadow Properties Values.
568
580
*
581
+ * @param mixed[] $propertiesMap
582
+ * @param null|mixed[] $reference
583
+ *
569
584
* @return $this
570
585
*/
571
586
protected function setShadowPropertiesMapValues (array $ propertiesMap , ?array &$ reference = null )
@@ -574,8 +589,13 @@ protected function setShadowPropertiesMapValues(array $propertiesMap, ?array &$r
574
589
foreach ($ propertiesMap as $ property_key => $ property_val ) {
575
590
if (is_array ($ property_val )) {
576
591
if (in_array ($ property_key , self ::SHADOW_ARRAY_KEYS , true )) {
577
- $ reference = &$ this ->shadowProperties [$ property_key ];
578
- $ this ->setShadowPropertiesMapValues ($ property_val , $ reference );
592
+ /** @var null|array<mixed> */
593
+ $ temp = &$ this ->shadowProperties [$ property_key ];
594
+ $ reference = &$ temp ;
595
+ $ this ->setShadowPropertiesMapValues (
596
+ $ property_val ,
597
+ $ reference
598
+ );
579
599
}
580
600
} else {
581
601
if ($ base_reference === null ) {
@@ -640,6 +660,8 @@ public function getShadowColorObject(): ChartColor
640
660
* Get Shadow Property.
641
661
*
642
662
* @param string|string[] $elements
663
+ *
664
+ * @return null|mixed[]|string
643
665
*/
644
666
public function getShadowProperty ($ elements ): array |string |null
645
667
{
@@ -662,6 +684,7 @@ public function getShadowProperty($elements): array|string|null
662
684
return $ retVal ;
663
685
}
664
686
687
+ /** @return mixed[] */
665
688
public function getShadowArray (): array
666
689
{
667
690
$ array = $ this ->shadowProperties ;
@@ -674,6 +697,7 @@ public function getShadowArray(): array
674
697
675
698
protected ChartColor $ lineColor ;
676
699
700
+ /** @var array{width: null|float|int|string, compound: ?string, dash: ?string, cap: ?string, join: ?string, arrow: array{head: array{type: ?string, size: null|int|string, w: ?string, len: ?string}, end: array{type: ?string, size: null|int|string, w: ?string, len: ?string}}} */
677
701
protected array $ lineStyleProperties = [
678
702
'width ' => null , //'9525',
679
703
'compound ' => '' , //self::LINE_STYLE_COMPOUND_SIMPLE,
@@ -798,13 +822,16 @@ public function setLineStyleProperties(
798
822
}
799
823
}
800
824
825
+ /** @return mixed[] */
801
826
public function getLineStyleArray (): array
802
827
{
803
828
return $ this ->lineStyleProperties ;
804
829
}
805
830
831
+ /** @param mixed[] $lineStyleProperties */
806
832
public function setLineStyleArray (array $ lineStyleProperties = []): self
807
833
{
834
+ /** @var array{width?: ?string, compound?: string, dash?: string, cap?: string, join?: string, arrow?: array{head?: array{type?: string, size?: int, w?: string, len?: string}, end?: array{type?: string, size?: int, w?: string, len?: string}}} $lineStyleProperties */
808
835
$ this ->activateObject ();
809
836
$ this ->lineStyleProperties ['width ' ] = $ lineStyleProperties ['width ' ] ?? null ;
810
837
$ this ->lineStyleProperties ['compound ' ] = $ lineStyleProperties ['compound ' ] ?? '' ;
@@ -826,13 +853,15 @@ public function setLineStyleArray(array $lineStyleProperties = []): self
826
853
public function setLineStyleProperty (string $ propertyName , mixed $ value ): self
827
854
{
828
855
$ this ->activateObject ();
829
- $ this ->lineStyleProperties [$ propertyName ] = $ value ;
856
+ $ this ->lineStyleProperties [$ propertyName ] = $ value ; //* @phpstan-ignore-line
830
857
831
858
return $ this ;
832
859
}
833
860
834
861
/**
835
862
* Get Line Style Property.
863
+ *
864
+ * @param array<mixed>|string $elements
836
865
*/
837
866
public function getLineStyleProperty (array |string $ elements ): ?string
838
867
{
@@ -873,7 +902,7 @@ protected function getLineStyleArrowSize(int $arraySelector, string $arrayKaySel
873
902
*/
874
903
public function getLineStyleArrowParameters (string $ arrowSelector , string $ propertySelector ): string
875
904
{
876
- return $ this ->getLineStyleArrowSize ($ this ->lineStyleProperties ['arrow ' ][$ arrowSelector ]['size ' ], $ propertySelector );
905
+ return $ this ->getLineStyleArrowSize (( int ) $ this ->lineStyleProperties ['arrow ' ][$ arrowSelector ]['size ' ], $ propertySelector );
877
906
}
878
907
879
908
/**
0 commit comments