Refactor GetContainersStatus.php for improved readability and maintainability

This commit is contained in:
Andras Bacsai 2024-05-08 15:04:13 +02:00
parent edf2a2e68d
commit bc5d3bea14

View File

@ -19,14 +19,14 @@ class GetContainersStatus
{ {
use AsAction; use AsAction;
public $applications; public $applications;
public function __construct(public Server $server) public $server;
public function handle(Server $server)
{ {
if (isDev()) { if (isDev()) {
$this->server = Server::find(0); $server = Server::find(0);
} }
} $this->server = $server;
public function handle()
{
if (!$this->server->isFunctional()) { if (!$this->server->isFunctional()) {
return 'Server is not ready.'; return 'Server is not ready.';
}; };