Image::makeFromImageJson()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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