File tree Expand file tree Collapse file tree 8 files changed +42
-70
lines changed Expand file tree Collapse file tree 8 files changed +42
-70
lines changed Original file line number Diff line number Diff line change 6
6
use App \Application \Analyze \AnalyzeAction ;
7
7
use App \Application \Analyze \AnalyzeRequest ;
8
8
use App \Application \Analyze \AnalyzePresenter ;
9
- use App \Commands \Analyze \GraphPresenterFactory ;
10
- use App \Presenter \Analyze \Graph \GraphPresenter ;
11
- use App \Commands \Analyze \SummaryPresenterFactory ;
12
- use App \Presenter \Analyze \Summary \SummaryPresenter ;
13
9
14
10
class AnalyzeCommand extends AbstractCommand
15
11
{
@@ -46,18 +42,6 @@ private function makeRequest(): AnalyzeRequest
46
42
47
43
private function makePresenter (): AnalyzePresenter
48
44
{
49
- return $ this ->option ('graph ' )
50
- ? $ this ->makeGraphPresenter ()
51
- : $ this ->makeSummaryPresenter ();
52
- }
53
-
54
- private function makeGraphPresenter (): GraphPresenter
55
- {
56
- return app (GraphPresenterFactory::class)->make ($ this );
57
- }
58
-
59
- private function makeSummaryPresenter (): SummaryPresenter
60
- {
61
- return app (SummaryPresenterFactory::class)->make ($ this );
45
+ return app (PresenterFactory::class)->make ($ this );
62
46
}
63
47
}
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace App \Commands \Analyze ;
3
+ namespace App \Commands \Analyze \ Graph ;
4
4
5
- use App \Commands \Analyze \TransformerFactory ;
6
5
use App \Presenter \Analyze \Graph \GraphView ;
7
6
use LaravelZero \Framework \Commands \Command ;
8
- use App \Commands \Analyze \GraphSettingsFactory ;
7
+ use App \Commands \Analyze \TransformerFactory ;
9
8
use App \Presenter \Analyze \Graph \GraphPresenter ;
10
9
use App \Presenter \Analyze \Graph \Ports \GraphMapper ;
10
+ use App \Commands \Analyze \Graph \GraphSettingsFactory ;
11
11
12
12
class GraphPresenterFactory
13
13
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace App \Commands \Analyze ;
3
+ namespace App \Commands \Analyze \ Graph ;
4
4
5
5
use LaravelZero \Framework \Commands \Command ;
6
6
use App \Presenter \Analyze \Graph \GraphSettings ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace App \Commands \Analyze ;
4
+
5
+ use Illuminate \Console \Command ;
6
+ use App \Commands \AbstractCommand ;
7
+ use App \Application \Analyze \AnalyzeAction ;
8
+ use App \Application \Analyze \AnalyzeRequest ;
9
+ use App \Application \Analyze \AnalyzePresenter ;
10
+ use App \Presenter \Analyze \Graph \GraphPresenter ;
11
+ use App \Presenter \Analyze \Summary \SummaryPresenter ;
12
+ use App \Commands \Analyze \Graph \GraphPresenterFactory ;
13
+ use App \Commands \Analyze \Summary \SummaryPresenterFactory ;
14
+
15
+ class PresenterFactory
16
+ {
17
+ public function make (Command $ command ): AnalyzePresenter
18
+ {
19
+ return $ command ->option ('graph ' )
20
+ ? $ this ->makeGraphPresenter ($ command )
21
+ : $ this ->makeSummaryPresenter ($ command );
22
+ }
23
+
24
+ private function makeGraphPresenter (Command $ command ): GraphPresenter
25
+ {
26
+ return app (GraphPresenterFactory::class)->make ($ command );
27
+ }
28
+
29
+ private function makeSummaryPresenter (Command $ command ): SummaryPresenter
30
+ {
31
+ return app (SummaryPresenterFactory::class)->make ($ command );
32
+ }
33
+ }
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace App \Commands \Analyze ;
3
+ namespace App \Commands \Analyze \ Summary ;
4
4
5
- use App \Commands \Analyze \TransformerFactory ;
6
5
use LaravelZero \Framework \Commands \Command ;
6
+ use App \Commands \Analyze \TransformerFactory ;
7
7
use App \Presenter \Analyze \Summary \SummaryView ;
8
- use App \Commands \Analyze \SummarySettingsFactory ;
9
8
use App \Presenter \Analyze \Summary \SummaryMapper ;
10
9
use App \Presenter \Analyze \Summary \SummaryPresenter ;
10
+ use App \Commands \Analyze \Summary \SummarySettingsFactory ;
11
11
12
12
class SummaryPresenterFactory
13
13
{
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace App \Commands \Analyze ;
3
+ namespace App \Commands \Analyze \ Summary ;
4
4
5
5
use LaravelZero \Framework \Commands \Command ;
6
6
use App \Presenter \Analyze \Summary \SummarySettings ;
You can’t perform that action at this time.
0 commit comments