From 62bffafeeafa679ff94037147304c8f905ce0690 Mon Sep 17 00:00:00 2001 From: maxlapko Date: Fri, 1 Aug 2014 16:23:49 +0400 Subject: [PATCH] Update MessageController.php Fixed order of checking config `format` property --- framework/console/controllers/MessageController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/console/controllers/MessageController.php b/framework/console/controllers/MessageController.php index b97c9701fb..1e1b5f1c4b 100644 --- a/framework/console/controllers/MessageController.php +++ b/framework/console/controllers/MessageController.php @@ -96,6 +96,9 @@ class MessageController extends Controller if (!is_dir($config['sourcePath'])) { throw new Exception("The source path {$config['sourcePath']} is not a valid directory."); } + if (empty($config['format']) || !in_array($config['format'], ['php', 'po', 'db'])) { + throw new Exception('Format should be either "php", "po" or "db".'); + } if (in_array($config['format'], ['php', 'po'])) { if (!isset($config['messagePath'])) { throw new Exception('The configuration file must specify "messagePath".'); @@ -106,9 +109,6 @@ class MessageController extends Controller if (empty($config['languages'])) { throw new Exception("Languages cannot be empty."); } - if (empty($config['format']) || !in_array($config['format'], ['php', 'po', 'db'])) { - throw new Exception('Format should be either "php", "po" or "db".'); - } $files = FileHelper::findFiles(realpath($config['sourcePath']), $config);