@@ -14,6 +14,7 @@ public function getProtos(): array
1414 $ packet ->addChild ($ this ->wrapperTag )->addChild ('get_protos ' );
1515 $ response = $ this ->client ->request ($ packet );
1616
17+ /** @psalm-suppress PossiblyNullPropertyFetch */
1718 return (array ) $ response ->protos ->proto ;
1819 }
1920
@@ -37,7 +38,7 @@ public function getKeyInfo(): array
3738 $ keyInfo = [];
3839 $ keyInfoXml = $ this ->getInfo ('key ' );
3940
40- foreach ($ keyInfoXml ->property as $ property ) {
41+ foreach ($ keyInfoXml ->property ?? [] as $ property ) {
4142 $ keyInfo [(string ) $ property ->name ] = (string ) $ property ->value ;
4243 }
4344
@@ -49,7 +50,7 @@ public function getComponents(): array
4950 $ components = [];
5051 $ componentsXml = $ this ->getInfo ('components ' );
5152
52- foreach ($ componentsXml ->component as $ component ) {
53+ foreach ($ componentsXml ->component ?? [] as $ component ) {
5354 $ components [(string ) $ component ->name ] = (string ) $ component ->version ;
5455 }
5556
@@ -61,7 +62,7 @@ public function getServiceStates(): array
6162 $ states = [];
6263 $ statesXml = $ this ->getInfo ('services_state ' );
6364
64- foreach ($ statesXml ->srv as $ service ) {
65+ foreach ($ statesXml ->srv ?? [] as $ service ) {
6566 $ states [(string ) $ service ->id ] = [
6667 'id ' => (string ) $ service ->id ,
6768 'title ' => (string ) $ service ->title ,
@@ -82,7 +83,7 @@ public function getShells(): array
8283 $ shells = [];
8384 $ shellsXml = $ this ->getInfo ('shells ' );
8485
85- foreach ($ shellsXml ->shell as $ shell ) {
86+ foreach ($ shellsXml ->shell ?? [] as $ shell ) {
8687 $ shells [(string ) $ shell ->name ] = (string ) $ shell ->path ;
8788 }
8889
@@ -106,7 +107,7 @@ public function getSiteIsolationConfig(): array
106107 $ config = [];
107108 $ configXml = $ this ->getInfo ('site-isolation-config ' );
108109
109- foreach ($ configXml ->property as $ property ) {
110+ foreach ($ configXml ->property ?? [] as $ property ) {
110111 $ config [(string ) $ property ->name ] = (string ) $ property ->value ;
111112 }
112113
0 commit comments