99
1010/**
1111 * Converts an XML element into a PHP array
12- *
13- * @phpstan-import-type PrettyNode from \SbWereWolf\XmlNavigator\Conversion\IFastXmlToArray
14- * @phpstan-import-type PrettyNodeValue from \SbWereWolf\XmlNavigator\Conversion\IFastXmlToArray
15- * @phpstan-import-type XmlAttributes from \SbWereWolf\XmlNavigator\Conversion\IFastXmlToArray
16- * @phpstan-type PrettyChildren array<string, PrettyNodeValue>
1712 */
1813class PrettyPrintComposer implements Notation
1914{
2015 /**
2116 * @param XMLReader $reader
2217 * @param string $valueIndex index for element value
2318 * @param string $attributesIndex index for attributes collection
24- * @return PrettyNode
19+ * @return array<string, mixed>
2520 */
2621 public static function compose (
2722 XMLReader $ reader ,
@@ -65,7 +60,7 @@ private static function needsReadToReachElement(
6560 /**
6661 * @param string $valueIndex
6762 * @param string $attributesIndex
68- * @return PrettyNode
63+ * @return array<string, mixed>
6964 */
7065 private static function composeEmptyElement (
7166 XMLReader $ reader ,
@@ -91,7 +86,7 @@ private static function composeEmptyElement(
9186 /**
9287 * @param string $valueIndex
9388 * @param string $attributesIndex
94- * @return PrettyNode
89+ * @return array<string, mixed>
9590 */
9691 private static function composeElement (
9792 XMLReader $ reader ,
@@ -115,7 +110,7 @@ private static function composeElement(
115110 ];
116111 }
117112
118- /** @var PrettyChildren $children */
113+ /** @var array<string, mixed> $children */
119114 $ children = [];
120115 $ value = '' ;
121116 $ hasValue = false ;
@@ -128,7 +123,6 @@ private static function composeElement(
128123 );
129124 /** @var string $childName */
130125 $ childName = self ::firstKey ($ child );
131- /** @var PrettyNodeValue $childValue */
132126 $ childValue = $ child [$ childName ];
133127 self ::appendChild ($ children , $ childName , $ childValue );
134128 continue ;
@@ -166,10 +160,10 @@ private static function composeElement(
166160 }
167161
168162 /**
169- * @param PrettyChildren $target
163+ * @param array<string, mixed> $target
170164 * @param string $childName
171- * @param PrettyNodeValue $childValue
172- * @param-out PrettyChildren $target
165+ * @param mixed $childValue
166+ * @param-out array<string, mixed> $target
173167 */
174168 private static function appendChild (
175169 array &$ target ,
@@ -197,9 +191,9 @@ private static function appendChild(
197191 }
198192
199193 /**
200- * @param PrettyChildren $children
201- * @param XmlAttributes $attributes
202- * @return PrettyNodeValue
194+ * @param array<string, mixed> $children
195+ * @param array<string, string> $attributes
196+ * @return mixed
203197 */
204198 private static function normalizeValue (
205199 array $ children ,
@@ -226,7 +220,7 @@ private static function normalizeValue(
226220 ];
227221 }
228222
229- /** @var array<string, PrettyNodeValue > $result */
223+ /** @var array<string, mixed > $result */
230224 $ result = [];
231225 if ($ attributes !== []) {
232226 $ result [$ attributesIndex ] = $ attributes ;
0 commit comments