Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
878 B
PHP
31 lines
878 B
PHP
<?php
|
|
|
|
namespace App\Services\Hosting;
|
|
|
|
use App\Models\CustomerHostingOrder;
|
|
use App\Models\HostingAccount;
|
|
use App\Services\Hosting\Contracts\PanelRuntimeInterface;
|
|
use App\Services\Hosting\PanelRuntimes\SharedHostingPanelRuntime;
|
|
use InvalidArgumentException;
|
|
use RuntimeException;
|
|
|
|
class PanelRuntimeResolver
|
|
{
|
|
public function __construct(
|
|
private SharedHostingPanelRuntime $sharedHostingRuntime,
|
|
) {}
|
|
|
|
public function forSubject(mixed $subject): PanelRuntimeInterface
|
|
{
|
|
if ($subject instanceof HostingAccount) {
|
|
return $this->sharedHostingRuntime;
|
|
}
|
|
|
|
if ($subject instanceof CustomerHostingOrder) {
|
|
throw new RuntimeException('Server-backed hosting panel runtime is not enabled yet for this order.');
|
|
}
|
|
|
|
throw new InvalidArgumentException('Unsupported panel runtime subject.');
|
|
}
|
|
}
|