Passed
Pull Request — master (#34)
by Adam
03:20
created

NotificationResponse::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 13
rs 9.9
cc 2
nc 2
nop 1
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
/**
6
 * Class NotificationResponse
7
 * @package AcquiaCloudApi\Response
8
 */
9
class NotificationResponse
10
{
11
    public $uuid;
12
    public $event;
13
    public $label;
14
    public $description;
15
    public $created_at;
16
    public $completed_at;
17
    public $status;
18
    public $progress;
19
    public $context;
20
    public $links;
21
    /**
22
     * MemberResponse constructor.
23
     * @param object $notification
24
     */
25
    public function __construct($notification)
26
    {
27
        $this->uuid = $notification->uuid;
28
        $this->event = $notification->event;
29
        $this->label = $notification->label;
30
        $this->description = $notification->description;
31
        $this->created_at = $notification->created_at;
32
        $this->completed_at = $notification->completed_at;
33
        $this->status = $notification->status;
34
        $this->progress = $notification->progress;
35
        $this->context = $notification->context;
36
        if (property_exists($notification, '_links')) {
37
            $this->links = $notification->_links;
38
        }
39
    }
40
}
41