Task::makeFromTaskJson()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
crap 1
1
<?php
2
3
namespace ChrisArmitage\ScalewayApi\Domain;
4
5
class Task
6
{
7
    protected $description;
8
    protected $progress;
9
    protected $status;
10
11 1
    protected function __construct($description, $progress, $status) {
12 1
        $this->description = $description;
13 1
        $this->progress = $progress;
14 1
        $this->status = $status;
15 1
    }
16
17 1
    static public function makeFromTaskJson($taskJson) {
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
18 1
        return new static(
19 1
            $taskJson->description,
20 1
            $taskJson->progress,
21 1
            $taskJson->status
22 1
        );
23
    }
24
25
    /**
26
     * @return mixed
27
     */
28 1
    public function getDescription() {
29 1
        return $this->description;
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35 1
    public function getProgress() {
36 1
        return $this->progress;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42 1
    public function getStatus() {
43 1
        return $this->status;
44
    }
45
}