File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,14 @@ public function useCaller(Client $caller): void
8383 $ this ->caller = $ caller ;
8484 if ($ caller ->lastCurlResponse ) {
8585 $ this ->rawXML = $ caller ->lastCurlResponse ;
86- $ xml = simplexml_load_string ($ this ->rawXML );
86+ $ xml = simplexml_load_string ($ this ->rawXML , ' SimpleXMLElement ' , \ LIBXML_NONET | \ LIBXML_NOCDATA );
8787 if ($ xml ) {
88- $ this ->state = (string ) $ xml ->attributes ('rsp ' , true )->state ;
89- $ this ->note = (string ) $ xml ->attributes ('rsp ' , true )->note ;
90- foreach ($ xml ->children ('rsp ' , true ) as $ responsePackItem ) {
88+ $ attrsRsp = $ xml ->attributes ('rsp ' , true );
89+ $ attrs = $ xml ->attributes ();
90+ $ this ->state = (string ) (($ attrsRsp ['state ' ] ?? $ attrs ['state ' ] ?? '' ) );
91+ $ this ->note = (string ) (($ attrsRsp ['note ' ] ?? $ attrs ['note ' ] ?? '' ) );
92+ $ children = iterator_to_array ($ xml ->children ('rsp ' , true ) ?: $ xml ->children ());
93+ foreach ($ children as $ responsePackItem ) {
9194 $ this ->processResponsePackItem ($ responsePackItem );
9295 }
9396 }
You can’t perform that action at this time.
0 commit comments