Test Setup Failed
Push — master ( ef125c...60f940 )
by he
08:55
created

Task   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 13
c 1
b 0
f 1
dl 0
loc 28
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A asQueueInfo() 0 11 1
A setSolution() 0 3 1
A setProblem() 0 3 1
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'    => intval($this->solution->language),
36
        ];
37
    }
38
}
39