@@ -43,9 +43,9 @@ class LocalizationFinder extends BaseCommand
4343 public function run (array $ params )
4444 {
4545 $ this ->verbose = array_key_exists ('verbose ' , $ params );
46- $ cliOptionShowNew = array_key_exists ('show-new ' , $ params );
47- $ cliOptionLocale = ! empty ($ params ['locale ' ]) ? $ params ['locale ' ] : null ;
48- $ cliOptionDir = ! empty ($ params ['dir ' ]) ? $ params ['dir ' ] : null ;
46+ $ optionShowNew = array_key_exists ('show-new ' , $ params );
47+ $ optionLocale = ! empty ($ params ['locale ' ]) ? $ params ['locale ' ] : null ;
48+ $ optionDir = ! empty ($ params ['dir ' ]) ? $ params ['dir ' ] : null ;
4949 $ currentLocale = Locale ::getDefault ();
5050 $ currentDir = APPPATH ;
5151 $ this ->languagePath = $ currentDir . 'Language ' ;
@@ -59,18 +59,18 @@ public function run(array $params)
5959 $ this ->languagePath = SUPPORTPATH . 'Language/ ' ;
6060 }
6161
62- if (is_string ($ cliOptionLocale )) {
63- if (! in_array ($ cliOptionLocale , config (App::class)->supportedLocales , true )) {
62+ if (is_string ($ optionLocale )) {
63+ if (! in_array ($ optionLocale , config (App::class)->supportedLocales , true )) {
6464 CLI ::error ('Error: Supported locales ' . implode (', ' , config (App::class)->supportedLocales ));
6565
6666 return -1 ;
6767 }
6868
69- $ currentLocale = $ cliOptionLocale ;
69+ $ currentLocale = $ optionLocale ;
7070 }
7171
72- if (is_string ($ cliOptionDir )) {
73- $ tempCurrentDir = realpath ($ currentDir . $ cliOptionDir );
72+ if (is_string ($ optionDir )) {
73+ $ tempCurrentDir = realpath ($ currentDir . $ optionDir );
7474
7575 if (false === $ tempCurrentDir ) {
7676 CLI ::error ('Error: Dir must be located in ' . $ currentDir );
@@ -124,7 +124,7 @@ public function run(array $params)
124124 $ languageDiff = $ this ->arrayDiffRecursive ($ languageFoundKeys [$ langFileName ], $ languageStoredKeys );
125125 $ countNewKeys += $ this ->arrayCountRecursive ($ languageDiff );
126126
127- if ($ cliOptionShowNew ) {
127+ if ($ optionShowNew ) {
128128 $ tableRows = array_merge ($ this ->arrayToTableRows ($ langFileName , $ languageDiff ), $ tableRows );
129129 } else {
130130 $ newLanguageKeys = array_replace_recursive ($ languageFoundKeys [$ langFileName ], $ languageStoredKeys );
@@ -146,7 +146,7 @@ public function run(array $params)
146146 }
147147 }
148148
149- if ($ cliOptionShowNew && ! empty ($ tableRows )) {
149+ if ($ optionShowNew && ! empty ($ tableRows )) {
150150 sort ($ tableRows );
151151 CLI ::table ($ tableRows , ['File ' , 'Key ' ]);
152152 }
0 commit comments