1111 */
1212final class JsonxTypeDecoder implements TypeDecoderInterface
1313{
14- private const DATATYPE_OBJECT = 'object ' ;
15- private const DATATYPE_ARRAY = 'array ' ;
16- private const DATATYPE_BOOLEAN = 'boolean ' ;
17- private const DATATYPE_STRING = 'string ' ;
18- private const DATATYPE_NUMBER = 'number ' ;
19- private const DATATYPE_NULL = 'null ' ;
14+ private const string DATATYPE_OBJECT = 'object ' ;
15+ private const string DATATYPE_ARRAY = 'array ' ;
16+ private const string DATATYPE_BOOLEAN = 'boolean ' ;
17+ private const string DATATYPE_STRING = 'string ' ;
18+ private const string DATATYPE_NUMBER = 'number ' ;
19+ private const string DATATYPE_NULL = 'null ' ;
2020
2121 public function getContentType (): string
2222 {
@@ -39,10 +39,7 @@ public function decode(string $data): array
3939 return $ this ->decodeNode ($ document ->documentElement );
4040 }
4141
42- /**
43- * @return null|array|bool|float|int|string
44- */
45- private function decodeNode (\DOMNode $ node )
42+ private function decodeNode (\DOMNode $ node ): array |bool |float |int |string |null
4643 {
4744 $ nodeName = $ node ->nodeName ;
4845
@@ -69,7 +66,7 @@ private function decodeNode(\DOMNode $node)
6966 }
7067
7168 if (self ::DATATYPE_NULL === $ nodeType ) {
72- return ;
69+ return null ;
7370 }
7471
7572 throw RuntimeException::createNotParsable ($ this ->getContentType ());
0 commit comments