Image   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 32
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A makeFromImageJson() 0 3 1
A getName() 0 3 1
A getId() 0 3 1
1
<?php
2
3
namespace ChrisArmitage\ScalewayApi\Domain;
4
5
class Image
6
{
7
    protected $name;
8
    protected $id;
9
10 1
    protected function __construct($imageJson) {
11 1
        $this->name = $imageJson->name;
12 1
        $this->id = $imageJson->id;
13 1
    }
14
15
    /**
16
     * @param $imageJson
17
     * @return static
18
     */
19 1
    static public function makeFromImageJson($imageJson) {
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
20 1
        return new static($imageJson);
21
    }
22
23
    /**
24
     * @return mixed
25
     */
26 1
    public function getName() {
27 1
        return $this->name;
28
    }
29
30
    /**
31
     * @return mixed
32
     */
33 1
    public function getId() {
34 1
        return $this->id;
35
    }
36
}
37