Skip to content

Commit

Permalink
Refactor code to use backticks for displaying database connection det…
Browse files Browse the repository at this point in the history
…ails in DbTestCommand.php
  • Loading branch information
ewilan-riviere committed Oct 21, 2024
1 parent fda578e commit 1c2b8fc
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Commands/Db/DbTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ public function handle()
$username = $connection->getConfig('username');
$password = $connection->getConfig('password');

$this->comment("Driver: {$driver}");
$this->comment("Database: {$database}");
$this->comment("Host: {$host}");
$this->comment("Port: {$port}");
$this->comment("Driver: `{$driver}`");
$this->comment("Database: `{$database}`");
$this->comment("Host: `{$host}`");
$this->comment("Port: `{$port}`");

if ($credentials) {
$this->comment("Username: {$username}");
$this->comment("Password: {$password}");
$this->comment("Username: `{$username}`");
$this->comment("Password: `{$password}`");
}

$this->newLine();

$this->comment("Try to ping database at {$host}:{$port}...");
$this->comment("Try to ping database at `{$host}:{$port}`...");
$available = $this->pingDatabase($host, $port);
$this->info($available ? 'Database is available.' : 'Database is not available.');

Expand Down Expand Up @@ -126,11 +126,11 @@ private function testConnection(\Illuminate\Database\Connection $connection): bo
}

$this->alert('Connection successful.');
$this->comment("Driver name: {$driverName}");
$this->comment("Server info: {$serverInfo}");
$this->comment("Client version: {$clientVersion}");
$this->comment("Server version: {$serverVersion}");
$this->comment("Connection status: {$connectionStatus}");
$this->comment("Driver name: `{$driverName}`");
$this->comment("Server info: `{$serverInfo}`");
$this->comment("Client version: `{$clientVersion}`");
$this->comment("Server version: `{$serverVersion}`");
$this->comment("Connection status: `{$connectionStatus}`");

return true;
}
Expand Down

0 comments on commit 1c2b8fc

Please sign in to comment.