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

ReferenceResponse   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
dl 0
loc 31
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
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