Completed
Push — master ( 395fb2...b0764c )
by he
10:48 queued 10s
created

Task::asQueueInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 8
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace App\Task;
4
5
use App\Entities\Problem;
6
use App\Entities\Solution;
7
8
class Task
9
{
10
    /** @var Solution */
11
    private $solution;
12
    /** @var Problem */
13
    private $problem;
14
15
    public function setProblem(Problem $problem)
16
    {
17
        $this->problem = $problem;
18
    }
19
20
    public function setSolution(Solution $solution)
21
    {
22
        $this->solution = $solution;
23
    }
24
25
    public function asQueueInfo()
26
    {
27
        return [
28
            'problem_id'   => $this->problem->id,
29
            'time_limit'   => $this->problem->time_limit,
30
            'memory_limit' => $this->problem->memory_limit,
31
            'is_special'   => $this->problem->spj,
32
33
            'solution_id' => $this->solution->id,
34
            'code'        => $this->solution->source->code,
35
            'language'    => $this->solution->language,
36
        ];
37
    }
38
}
39