File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
class PresenterFactory
11
11
{
12
+ public function __construct (
13
+ private readonly GraphPresenterFactory $ graphPresenterFactory ,
14
+ private readonly SummaryPresenterFactory $ summaryPresenterFactory ,
15
+ ) {}
16
+
12
17
public function make (Command $ command ): AnalyzePresenter
13
18
{
14
19
return $ command ->option ('graph ' )
@@ -18,11 +23,11 @@ public function make(Command $command): AnalyzePresenter
18
23
19
24
private function makeGraphPresenter (Command $ command ): AnalyzePresenter
20
25
{
21
- return app (GraphPresenterFactory::class) ->make ($ command );
26
+ return $ this -> graphPresenterFactory ->make ($ command );
22
27
}
23
28
24
29
private function makeSummaryPresenter (Command $ command ): AnalyzePresenter
25
30
{
26
- return app (SummaryPresenterFactory::class) ->make ($ command );
31
+ return $ this -> summaryPresenterFactory ->make ($ command );
27
32
}
28
33
}
Original file line number Diff line number Diff line change 9
9
10
10
class PresenterFactory
11
11
{
12
+ public function __construct (
13
+ private readonly GraphPresenterFactory $ graphPresenterFactory ,
14
+ private readonly SummaryPresenterFactory $ summaryPresenterFactory ,
15
+ ) {}
16
+
12
17
public function make (Command $ command ): AnalyzePresenter
13
18
{
14
19
return $ command ->option ('graph ' )
@@ -18,11 +23,11 @@ public function make(Command $command): AnalyzePresenter
18
23
19
24
private function makeGraphPresenter (Command $ command ): AnalyzePresenter
20
25
{
21
- return app (GraphPresenterFactory::class) ->make ($ command );
26
+ return $ this -> graphPresenterFactory ->make ($ command );
22
27
}
23
28
24
29
private function makeSummaryPresenter (Command $ command ): AnalyzePresenter
25
30
{
26
- return app (SummaryPresenterFactory::class) ->make ($ command );
31
+ return $ this -> summaryPresenterFactory ->make ($ command );
27
32
}
28
33
}
You can’t perform that action at this time.
0 commit comments