1414use Shel \CriticalCSS \Service \StylesService ;
1515
1616/**
17- * Adds all attributes as css styles into a style tag with a css class and adds the class to the tag
17+ * Adds all attributes as CSS styles into a style tag with a CSS class and adds the class to the tag
1818 */
1919class StylesImplementation extends DataStructureImplementation
2020{
@@ -28,12 +28,12 @@ class StylesImplementation extends DataStructureImplementation
2828 /**
2929 * Properties that are ignored
3030 *
31- * @var array
31+ * @var string[]
3232 */
3333 protected $ ignoreProperties = ['__meta ' ];
3434
3535 /**
36- * The content that will be applied the generated css class or
36+ * The content that will be applied the generated CSS class or
3737 * if it's multiple elements they will be wrapped with a new
3838 * tag and the generated class. See `fallbackTagName`.
3939 */
@@ -53,7 +53,7 @@ protected function getFallbackTagName(): string
5353 }
5454
5555 /**
56- * When this is set a selector is used instead of the generated class.
56+ * When this is set, a selector is used instead of the generated class.
5757 */
5858 protected function getSelector (): bool |string
5959 {
@@ -75,6 +75,7 @@ protected function getClassPrefix(): string
7575
7676 /**
7777 * @throws FusionException
78+ * @phpstan-ignore method.childReturnType
7879 */
7980 public function evaluate (): string
8081 {
@@ -87,7 +88,7 @@ public function evaluate(): string
8788 foreach ($ sortedChildFusionKeys as $ key ) {
8889 $ value = $ this ->fusionValue ($ key );
8990
90- // When using simple nesting with `{` instead of using Neos.Fusion:DataStructure
91+ // When using simple nesting with `{` instead of using Neos.Fusion:DataStructure,
9192 // we have to retrieve the value from the properties as the value is null.
9293 if ($ value === null && array_key_exists ($ key , $ this ->properties )) {
9394 $ value = $ this ->properties [$ key ];
@@ -99,7 +100,7 @@ public function evaluate(): string
99100 $ styleProperties [$ key ] = $ value ;
100101 }
101102
102- $ path = [$ selector !== false ? $ selector : '. ' . $ classPrefix . '#{$hash} ' ];
103+ $ path = [$ selector !== false ? ( string ) $ selector : '. ' . $ classPrefix . '#{$hash} ' ];
103104 $ stylesHash = $ this ->stylesService ->getHashForStyles ($ styleProperties , $ path );
104105 $ styles = $ this ->stylesService ->renderStyles ($ styleProperties , $ path );
105106 $ styles = str_replace ('#{$hash} ' , $ stylesHash , $ styles );
@@ -126,7 +127,7 @@ public function evaluate(): string
126127
127128 /**
128129 * @param string $path
129- * @param array $props
130+ * @param array<string, mixed> $props
130131 */
131132 protected function evaluateNestedProps (string $ path , array &$ props ): void
132133 {
0 commit comments