DatabaseResponse::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
c 4
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 9.9666
1
<?php
2
3
namespace AcquiaCloudApi\Response;
4
5
class DatabaseResponse
6
{
7
    public string $id;
8
    public string $name;
9
    // Connection details will be missing without the required permission:
10
    // "View database connection details (username, password, or hostname)"
11
    public ?string $user_name;
12
    public ?string $password;
13
    public ?string $url;
14
    public string $db_host;
15
    public ?string $ssh_host;
16
    public object $flags;
17
    public object $environment;
18
19
    public function __construct(object $database)
20
    {
21
        $this->id = $database->id;
22
        $this->name = $database->name;
23
        $this->user_name = $database->user_name ?? null;
24
        $this->password = $database->password ?? null;
25
        $this->url = $database->url ?? null;
26
        $this->db_host = $database->db_host;
27
        $this->ssh_host = $database->ssh_host ?? null;
28
        $this->flags = $database->flags;
29
        $this->environment = $database->environment;
30
    }
31
}
32