@@ -28,10 +28,10 @@ public function save()
28
28
*/
29
29
public function getFrontends ()
30
30
{
31
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
31
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
32
32
return [];
33
33
}
34
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
34
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
35
35
return [];
36
36
}
37
37
@@ -60,10 +60,10 @@ public function getFrontendNames()
60
60
*/
61
61
public function getBackends ()
62
62
{
63
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
63
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
64
64
return [];
65
65
}
66
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
66
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
67
67
return [];
68
68
}
69
69
@@ -93,10 +93,10 @@ public function getBackendNames()
93
93
*/
94
94
public function frontendExists ($ name )
95
95
{
96
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
96
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
97
97
return false ;
98
98
}
99
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
99
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
100
100
return false ;
101
101
}
102
102
@@ -117,10 +117,10 @@ public function frontendExists($name)
117
117
*/
118
118
public function backendExists ($ name )
119
119
{
120
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
120
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
121
121
return false ;
122
122
}
123
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
123
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
124
124
return false ;
125
125
}
126
126
@@ -141,10 +141,10 @@ public function backendExists($name)
141
141
*/
142
142
public function getFrontend ($ name )
143
143
{
144
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
144
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
145
145
return ;
146
146
}
147
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
147
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
148
148
return ;
149
149
}
150
150
@@ -163,10 +163,10 @@ public function getFrontend($name)
163
163
*/
164
164
public function getFrontendKey ($ name )
165
165
{
166
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
166
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
167
167
return ;
168
168
}
169
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
169
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
170
170
return ;
171
171
}
172
172
@@ -185,10 +185,10 @@ public function getFrontendKey($name)
185
185
*/
186
186
public function getBackend ($ name )
187
187
{
188
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
188
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
189
189
return ;
190
190
}
191
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
191
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
192
192
return ;
193
193
}
194
194
@@ -207,10 +207,10 @@ public function getBackend($name)
207
207
*/
208
208
public function getBackendKey ($ name )
209
209
{
210
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
210
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
211
211
return ;
212
212
}
213
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
213
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
214
214
return ;
215
215
}
216
216
@@ -228,10 +228,10 @@ public function getBackendKey($name)
228
228
*/
229
229
public function removeFrontend ($ name )
230
230
{
231
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
231
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
232
232
return ;
233
233
}
234
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
234
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
235
235
return ;
236
236
}
237
237
@@ -253,10 +253,10 @@ public function removeFrontend($name)
253
253
*/
254
254
public function removeBackend ($ name )
255
255
{
256
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
256
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
257
257
return ;
258
258
}
259
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
259
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
260
260
return ;
261
261
}
262
262
@@ -282,10 +282,10 @@ public function putFrontend($item)
282
282
$ key = $ this ->getFrontendKey ($ item ['name ' ]);
283
283
$ this ->data ['ha_backends ' ]['item ' ][$ key ] = $ item ;
284
284
} else {
285
- if (!key_exists ( ' ha_backends ' , $ this ->data )) {
285
+ if (!is_array ( $ this ->data [ ' ha_backends ' ] )) {
286
286
$ this ->data ['ha_backends ' ] = [];
287
287
}
288
- if (!key_exists ( ' item ' , $ this ->data ['ha_backends ' ])) {
288
+ if (!is_array ( $ this ->data ['ha_backends ' ][ ' item ' ])) {
289
289
$ this ->data ['ha_backends ' ]['item ' ] = [];
290
290
}
291
291
@@ -304,10 +304,10 @@ public function putBackend($item)
304
304
$ key = $ this ->getBackendKey ($ item ['name ' ]);
305
305
$ this ->data ['ha_pools ' ]['item ' ][$ key ] = $ item ;
306
306
} else {
307
- if (!key_exists ( ' ha_pools ' , $ this ->data )) {
307
+ if (!is_array ( $ this ->data [ ' ha_pools ' ] )) {
308
308
$ this ->data ['ha_pools ' ] = [];
309
309
}
310
- if (!key_exists ( ' item ' , $ this ->data ['ha_pools ' ])) {
310
+ if (!is_array ( $ this ->data ['ha_pools ' ][ ' item ' ])) {
311
311
$ this ->data ['ha_pools ' ]['item ' ] = [];
312
312
}
313
313
0 commit comments