Passed
Push — master ( 62dee2...4b8e5c )
by Dane
02:13
created

ReferenceResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 10
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
class ReferenceResponse
6
{
7
    public string $id;
8
9
    public string $name;
10
11
    public string $type;
12
13
    public ?string $commit_id = null;
14
15
    public ?string $commit_message = null;
16
17
    public ?string $commit_author = null;
18
19
    public ?string $commit_date = null;
20
21
    public object $links;
22
23
    /**
24
     * ReferenceResponse constructor.
25
     */
26
    public function __construct(object $reference)
27
    {
28
        $this->id = $reference->id;
29
        $this->name = $reference->name;
30
        $this->type = $reference->type;
31
        $this->commit_id = $reference->commit_id ?? null;
32
        $this->commit_message = $reference->commit_message ?? null;
33
        $this->commit_author = $reference->commit_author ?? null;
34
        $this->commit_date = $reference->commit_date ?? null;
35
        $this->links = $reference->_links;
36
    }
37
}
38