@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $this->climate->table($summary); |
| 48 | 48 | |
| 49 | 49 | if($showErrors !== true){ |
| 50 | - return ExitCode::OK; |
|
| 50 | + return ExitCode::OK; |
|
| 51 | 51 | } |
| 52 | 52 | $this->headline('Failed for resolve', 'lightYellow'); |
| 53 | 53 | if(!count($service->errorList())){ |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $this->headline('Failed for resolve', 'lightYellow'); |
| 62 | 62 | if(!count($service->errorList())){ |
| 63 | 63 | $this->climate->info('Errors not found'); |
| 64 | - }else{ |
|
| 64 | + } else{ |
|
| 65 | 65 | Output::arrayList($service->errorList()); |
| 66 | 66 | } |
| 67 | 67 | return ExitCode::OK; |
@@ -55,13 +55,13 @@ discard block |
||
| 55 | 55 | $this->headline('YII-2 Code Statistic', 'lightYellow'); |
| 56 | 56 | $this->climate->table($summary); |
| 57 | 57 | |
| 58 | - if($showErrors !== true){ |
|
| 58 | + if ($showErrors !== true) { |
|
| 59 | 59 | return ExitCode::OK; |
| 60 | 60 | } |
| 61 | 61 | $this->headline('Failed for resolve', 'lightYellow'); |
| 62 | - if(!count($service->errorList())){ |
|
| 62 | + if (!count($service->errorList())) { |
|
| 63 | 63 | $this->climate->info('Errors not found'); |
| 64 | - }else{ |
|
| 64 | + } else { |
|
| 65 | 65 | Output::arrayList($service->errorList()); |
| 66 | 66 | } |
| 67 | 67 | return ExitCode::OK; |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | $statistic = $service->makeAdvancedStatistic($this->module->prepareFiles(), $this->module->metrics); |
| 79 | 79 | $this->headline('YII-2 Code Statistic', 'green'); |
| 80 | 80 | |
| 81 | - if($groupName !==null){ |
|
| 82 | - if(!isset($statistic[$groupName])){ |
|
| 83 | - $this->stderr('Undefined group '.$groupName); |
|
| 81 | + if ($groupName !== null) { |
|
| 82 | + if (!isset($statistic[$groupName])) { |
|
| 83 | + $this->stderr('Undefined group ' . $groupName); |
|
| 84 | 84 | return ExitCode::DATAERR; |
| 85 | 85 | } |
| 86 | 86 | $this->headline($groupName, 'lightYellow'); |
@@ -88,10 +88,10 @@ discard block |
||
| 88 | 88 | return ExitCode::OK; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - foreach ($statistic as $group =>$data){ |
|
| 91 | + foreach ($statistic as $group =>$data) { |
|
| 92 | 92 | $this->headline($group, 'lightYellow'); |
| 93 | 93 | Output::arrayList($data); |
| 94 | - if(!$this->confirm('Show next group?')){ |
|
| 94 | + if (!$this->confirm('Show next group?')) { |
|
| 95 | 95 | break; |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $service = $this->module->statService; |
| 122 | 122 | $dir = \Yii::getAlias($dir); |
| 123 | - if(!is_dir($dir)){ |
|
| 124 | - $this->stderr('Directory not found by path '.$dir); |
|
| 123 | + if (!is_dir($dir)) { |
|
| 124 | + $this->stderr('Directory not found by path ' . $dir); |
|
| 125 | 125 | return ExitCode::UNSPECIFIED_ERROR; |
| 126 | 126 | } |
| 127 | 127 | $statistic = $service->makeCommonStatistic(FileHelper::findFiles($dir, [ |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $service = $this->module->statService; |
| 145 | 145 | $filePath = \Yii::getAlias($filePath); |
| 146 | - if(!file_exists($filePath)){ |
|
| 147 | - $this->stderr('File not found by path '.$filePath); |
|
| 146 | + if (!file_exists($filePath)) { |
|
| 147 | + $this->stderr('File not found by path ' . $filePath); |
|
| 148 | 148 | return ExitCode::UNSPECIFIED_ERROR; |
| 149 | 149 | } |
| 150 | 150 | $statistic = $service->makeCommonStatistic([$filePath], $this->module->metrics); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $value = $this->wrap($value, 'light_cyan'); |
| 187 | 187 | } |
| 188 | 188 | $key = $this->wrap($key, 'green'); |
| 189 | - $colorized[$i][$key] = (string)$value; |
|
| 189 | + $colorized[$i][$key] = (string) $value; |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | return $colorized; |
@@ -234,14 +234,14 @@ |
||
| 234 | 234 | public function classGenerator(array $files) |
| 235 | 235 | { |
| 236 | 236 | foreach ($files as $filePath) { |
| 237 | - try{ |
|
| 237 | + try { |
|
| 238 | 238 | $className = $this->classDetector->resolveClassName($filePath); |
| 239 | 239 | if ($className === null) { |
| 240 | 240 | ++$this->nonClasses; |
| 241 | 241 | } else { |
| 242 | 242 | yield $className; |
| 243 | 243 | } |
| 244 | - }catch (\Throwable $e){ |
|
| 244 | + } catch (\Throwable $e) { |
|
| 245 | 245 | $this->withErrors[] = $e->getMessage(); |
| 246 | 246 | } |
| 247 | 247 | } |
@@ -241,7 +241,7 @@ |
||
| 241 | 241 | } else { |
| 242 | 242 | yield $className; |
| 243 | 243 | } |
| 244 | - }catch (\Throwable $e){ |
|
| 244 | + } catch (\Throwable $e){ |
|
| 245 | 245 | $this->withErrors[] = $e->getMessage(); |
| 246 | 246 | } |
| 247 | 247 | } |