Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | class GenerateTask extends Command |
||
11 | { |
||
12 | protected $signature = 'task:make {id}'; |
||
13 | |||
14 | protected $description = 'Generate Task by Solution Id'; |
||
15 | |||
16 | public function handle() |
||
17 | { |
||
18 | $solution = $this->getSolution(); |
||
19 | $task = $this->generateTask($solution); |
||
20 | |||
21 | $this->send($task); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return Solution |
||
26 | */ |
||
27 | private function getSolution() |
||
32 | } |
||
33 | |||
34 | private function generateTask(Solution $solution) |
||
35 | { |
||
36 | $task = app(Task::class); |
||
37 | $task->setSolution($solution); |
||
38 | $task->setProblem($solution->problem); |
||
39 | |||
40 | return $task; |
||
41 | } |
||
42 | |||
43 | private function send($task) |
||
48 | } |
||
49 | } |
||
50 |