@@ -205,6 +205,7 @@ public function getOptionsList()
205
205
public function validate (InputInterface $ input )
206
206
{
207
207
$ errors = [];
208
+ $ errorMsg = '' ;
208
209
$ options = $ input ->getOptions ();
209
210
foreach ($ options as $ key => $ value ) {
210
211
if (!$ value ) {
@@ -220,92 +221,61 @@ public function validate(InputInterface $input)
220
221
StoreConfigurationDataMapper::KEY_BASE_URL ,
221
222
['http ' , 'https ' ]
222
223
);
223
- if ($ errorMsg !== '' ) {
224
- $ errors [] = $ errorMsg ;
225
- }
224
+
226
225
break ;
227
226
case StoreConfigurationDataMapper::KEY_LANGUAGE :
228
227
$ errorMsg = $ this ->validateCodes (
229
228
$ this ->localeValidator ,
230
229
$ value ,
231
230
StoreConfigurationDataMapper::KEY_LANGUAGE
232
231
);
233
- if ($ errorMsg !== '' ) {
234
- $ errors [] = $ errorMsg ;
235
- }
236
232
break ;
237
233
case StoreConfigurationDataMapper::KEY_TIMEZONE :
238
234
$ errorMsg = $ this ->validateCodes (
239
235
$ this ->timezoneValidator ,
240
236
$ value ,
241
237
StoreConfigurationDataMapper::KEY_TIMEZONE
242
238
);
243
- if ($ errorMsg !== '' ) {
244
- $ errors [] = $ errorMsg ;
245
- }
246
239
break ;
247
240
case StoreConfigurationDataMapper::KEY_CURRENCY :
248
241
$ errorMsg = $ this ->validateCodes (
249
242
$ this ->currencyValidator ,
250
243
$ value ,
251
244
StoreConfigurationDataMapper::KEY_CURRENCY
252
245
);
253
- if ($ errorMsg !== '' ) {
254
- $ errors [] = $ errorMsg ;
255
- }
256
246
break ;
257
247
case StoreConfigurationDataMapper::KEY_USE_SEF_URL :
258
248
$ errorMsg = $ this ->validateBinaryValue ($ value , StoreConfigurationDataMapper::KEY_USE_SEF_URL );
259
- if ($ errorMsg !== '' ) {
260
- $ errors [] = $ errorMsg ;
261
- }
262
249
break ;
263
250
case StoreConfigurationDataMapper::KEY_IS_SECURE :
264
251
$ errorMsg = $ this ->validateBinaryValue ($ value , StoreConfigurationDataMapper::KEY_IS_SECURE );
265
- if ($ errorMsg !== '' ) {
266
- $ errors [] = $ errorMsg ;
267
- }
268
252
break ;
269
253
case StoreConfigurationDataMapper::KEY_BASE_URL_SECURE :
270
- try {
271
- $ errorMsg = $ this ->validateUrl (
272
- $ value ,
273
- StoreConfigurationDataMapper::KEY_BASE_URL_SECURE ,
274
- ['https ' ]
275
- );
276
- if ($ errorMsg !== '' ) {
277
- $ errors [] = $ errorMsg ;
278
- }
279
- } catch (LocalizedException $ e ) {
280
- $ errors [] = '<error> ' . 'Command option \'' . StoreConfigurationDataMapper::KEY_BASE_URL_SECURE
281
- . '\': ' . $ e ->getLogMessage () .'</error> ' ;
282
- }
254
+ $ errorMsg = $ this ->validateUrl (
255
+ $ value ,
256
+ StoreConfigurationDataMapper::KEY_BASE_URL_SECURE ,
257
+ ['https ' ]
258
+ );
283
259
break ;
284
260
case StoreConfigurationDataMapper::KEY_IS_SECURE_ADMIN :
285
261
$ errorMsg = $ this ->validateBinaryValue ($ value , StoreConfigurationDataMapper::KEY_IS_SECURE_ADMIN );
286
- if ($ errorMsg !== '' ) {
287
- $ errors [] = $ errorMsg ;
288
- }
289
262
break ;
290
263
case StoreConfigurationDataMapper::KEY_ADMIN_USE_SECURITY_KEY :
291
264
$ errorMsg = $ this ->validateBinaryValue (
292
265
$ value ,
293
266
StoreConfigurationDataMapper::KEY_ADMIN_USE_SECURITY_KEY
294
267
);
295
- if ($ errorMsg !== '' ) {
296
- $ errors [] = $ errorMsg ;
297
- }
298
268
break ;
299
269
case StoreConfigurationDataMapper::KEY_JS_LOGGING :
300
270
$ errorMsg = $ this ->validateBinaryValue (
301
271
$ value ,
302
272
StoreConfigurationDataMapper::KEY_JS_LOGGING
303
273
);
304
- if ($ errorMsg !== '' ) {
305
- $ errors [] = $ errorMsg ;
306
- }
307
274
break ;
308
275
}
276
+ if ($ errorMsg !== '' ) {
277
+ $ errors [] = $ errorMsg ;
278
+ }
309
279
}
310
280
return $ errors ;
311
281
}
0 commit comments