Skip to content

Commit

Permalink
CLI-1046: user_name is null (#384)
Browse files Browse the repository at this point in the history
* CLI-1046: user_name is null

* use coalescing operator

* Add db id
  • Loading branch information
danepowell authored May 3, 2023
1 parent e68b1ca commit 1a43baf
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Response/DatabaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@

class DatabaseResponse
{
public string $id;
public string $name;
public string $user_name;
public string $password;
public string $url;
// Connection details will be missing without the required permission:
// "View database connection details (username, password, or hostname)"
public ?string $user_name;
public ?string $password;
public ?string $url;
public string $db_host;
public string $ssh_host;
public ?string $ssh_host;
public object $flags;
public object $environment;

public function __construct(object $database)
{
$this->id = $database->id;
$this->name = $database->name;
$this->user_name = $database->user_name;
$this->password = $database->password;
$this->url = $database->url;
$this->user_name = $database->user_name ?? null;
$this->password = $database->password ?? null;
$this->url = $database->url ?? null;
$this->db_host = $database->db_host;
$this->ssh_host = $database->ssh_host;
$this->ssh_host = $database->ssh_host ?? null;
$this->flags = $database->flags;
$this->environment = $database->environment;
}
Expand Down

0 comments on commit 1a43baf

Please sign in to comment.