Passed
Branch master (8d5159)
by Chris
03:21
created

Task   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 41
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A makeFromTaskJson() 0 7 1
A getDescription() 0 3 1
A getProgress() 0 3 1
A getStatus() 0 3 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
}