File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
Presenter/Analyze/Summary Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class AnalyzeCommand extends AbstractCommand
18
18
{--depth-limit=}
19
19
{--debug}
20
20
{--info}
21
- {--h : Display human readable metrics}
21
+ {--human-readable : Display human readable metrics}
22
22
' ;
23
23
24
24
protected $ description = 'Analyze the given path ' ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public function make(Command $command): SummarySettings
12
12
return new SummarySettings (
13
13
debug: $ command ->option ('debug ' ),
14
14
info: $ command ->option ('info ' ),
15
- humanReadable: $ command ->option ('h ' ),
15
+ humanReadable: $ command ->option ('human-readable ' ),
16
16
);
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ public function show(SummaryViewModel $viewModel): void
17
17
18
18
private function displayMetrics (SummaryViewModel $ viewModel ): void
19
19
{
20
- count ( $ viewModel ->metrics ()) === 0
21
- ? warning ( ' No classes found ' )
22
- : $ this -> showTable ( $ viewModel );
20
+ $ viewModel ->hasMetrics ()
21
+ ? $ this -> showMetrics ( $ viewModel )
22
+ : warning ( ' No classes found ' );
23
23
}
24
24
25
- private function showTable (SummaryViewModel $ viewModel ): void
25
+ private function showMetrics (SummaryViewModel $ viewModel ): void
26
26
{
27
27
table (
28
28
headers: $ viewModel ->headers (),
@@ -72,6 +72,7 @@ private function showMetricsInfo(): void
72
72
outro ('Class with a low instability (I close to 0) is strongly used and probably critical for the application, its business logic must be tested. ' );
73
73
outro ('Class with a high instability (I close to 1) can suffer from side effects of its dependencies and must favor abstractions. ' );
74
74
outro ('Class with a high abstractness (A close to 1) is totally abstract and should not have any concrete code. ' );
75
+ outro ('Try --human-readable to get a more human readable output. ' );
75
76
outro ('See the documentation for more information : https://php-quality-tools.com/class-dependencies-analyzer ' );
76
77
}
77
78
Original file line number Diff line number Diff line change @@ -38,4 +38,9 @@ public function count(): int
38
38
{
39
39
return $ this ->count ;
40
40
}
41
+
42
+ public function hasMetrics (): bool
43
+ {
44
+ return count ($ this ->metrics ) > 0 ;
45
+ }
41
46
}
You can’t perform that action at this time.
0 commit comments