@@ -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())){ |
@@ -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,11 +88,11 @@ 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 | //$this->climate->table($data); |
94 | 94 | Output::arrayList($data); |
95 | - if(!$this->confirm('Show next group?')){ |
|
95 | + if (!$this->confirm('Show next group?')) { |
|
96 | 96 | break; |
97 | 97 | } |
98 | 98 | } |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | { |
123 | 123 | $service = $this->module->statService; |
124 | 124 | $dir = \Yii::getAlias($dir); |
125 | - if(!is_dir($dir)){ |
|
126 | - $this->stderr('Directory not found by path '.$dir); |
|
125 | + if (!is_dir($dir)) { |
|
126 | + $this->stderr('Directory not found by path ' . $dir); |
|
127 | 127 | return ExitCode::UNSPECIFIED_ERROR; |
128 | 128 | } |
129 | 129 | $statistic = $service->makeCommonStatistic(FileHelper::findFiles($dir, [ |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | { |
147 | 147 | $service = $this->module->statService; |
148 | 148 | $filePath = \Yii::getAlias($filePath); |
149 | - if(!file_exists($filePath)){ |
|
150 | - $this->stderr('File not found by path '.$filePath); |
|
149 | + if (!file_exists($filePath)) { |
|
150 | + $this->stderr('File not found by path ' . $filePath); |
|
151 | 151 | return ExitCode::UNSPECIFIED_ERROR; |
152 | 152 | } |
153 | 153 | $statistic = $service->makeCommonStatistic([$filePath], $this->module->metrics); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $value = $this->wrap($value, 'light_cyan'); |
191 | 191 | } |
192 | 192 | $key = $this->wrap($key, 'green'); |
193 | - $colorized[$i][$key] = (string)$value; |
|
193 | + $colorized[$i][$key] = (string) $value; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | return $colorized; |
@@ -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; |
@@ -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 | } |