Test Setup Failed
Push — master ( 8fab9f...8d5159 )
by Chris
02:48
created

Task::makeFromTaskJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 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
    protected function __construct($description, $progress, $status) {
12
        $this->description = $description;
13
        $this->progress = $progress;
14
        $this->status = $status;
15
    }
16
17
    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
        return new static(
19
            $taskJson->description,
20
            $taskJson->progress,
21
            $taskJson->status
22
        );
23
    }
24
25
    /**
26
     * @return mixed
27
     */
28
    public function getDescription() {
29
        return $this->description;
30
    }
31
32
    /**
33
     * @return mixed
34
     */
35
    public function getProgress() {
36
        return $this->progress;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getStatus() {
43
        return $this->status;
44
    }
45
}