mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
update composer (#84)
* update composer log viewer code style format * fix composer
This commit is contained in:
@ -15,13 +15,13 @@ public function create(
|
||||
?int $siteId = null
|
||||
): void;
|
||||
|
||||
public function delete(int $id, int $siteId = null): void;
|
||||
public function delete(int $id, ?int $siteId = null): void;
|
||||
|
||||
public function restart(int $id, int $siteId = null): void;
|
||||
public function restart(int $id, ?int $siteId = null): void;
|
||||
|
||||
public function stop(int $id, int $siteId = null): void;
|
||||
public function stop(int $id, ?int $siteId = null): void;
|
||||
|
||||
public function start(int $id, int $siteId = null): void;
|
||||
public function start(int $id, ?int $siteId = null): void;
|
||||
|
||||
public function getLogs(string $logPath): string;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public function credentialData(array $input): array;
|
||||
|
||||
public function data(array $input): array;
|
||||
|
||||
public function connect(array $credentials = null): bool;
|
||||
public function connect(?array $credentials = null): bool;
|
||||
|
||||
public function plans(): array;
|
||||
|
||||
|
@ -6,7 +6,7 @@ interface SourceControlProvider
|
||||
{
|
||||
public function connect(): bool;
|
||||
|
||||
public function getRepo(string $repo = null): mixed;
|
||||
public function getRepo(?string $repo = null): mixed;
|
||||
|
||||
public function fullRepoUrl(string $repo, string $key): string;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
class SourceControlIsNotConnected extends Exception
|
||||
{
|
||||
public function __construct(protected SourceControl|string|null $sourceControl, string $message = null)
|
||||
public function __construct(protected SourceControl|string|null $sourceControl, ?string $message = null)
|
||||
{
|
||||
parent::__construct($message ?? 'Source control is not connected');
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class SSH
|
||||
|
||||
protected PrivateKey $privateKey;
|
||||
|
||||
public function init(Server $server, string $asUser = null): self
|
||||
public function init(Server $server, ?string $asUser = null): self
|
||||
{
|
||||
$this->connection = null;
|
||||
$this->log = null;
|
||||
@ -87,7 +87,7 @@ public function connect(bool $sftp = false): void
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function exec(string|array|SSHCommand $commands, string $log = '', int $siteId = null): string
|
||||
public function exec(string|array|SSHCommand $commands, string $log = '', ?int $siteId = null): string
|
||||
{
|
||||
if ($log) {
|
||||
$this->setLog($log, $siteId);
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
class AutoDeployment extends Component
|
||||
{
|
||||
use RefreshComponentOnBroadcast;
|
||||
use HasToast;
|
||||
use RefreshComponentOnBroadcast;
|
||||
|
||||
public Site $site;
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
class Deploy extends Component
|
||||
{
|
||||
use RefreshComponentOnBroadcast;
|
||||
use HasToast;
|
||||
use RefreshComponentOnBroadcast;
|
||||
|
||||
public Site $site;
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
class DeploymentsList extends Component
|
||||
{
|
||||
use RefreshComponentOnBroadcast;
|
||||
use HasCustomPaginationView;
|
||||
use RefreshComponentOnBroadcast;
|
||||
|
||||
public Site $site;
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
class LogsList extends Component
|
||||
{
|
||||
use RefreshComponentOnBroadcast;
|
||||
use HasCustomPaginationView;
|
||||
use RefreshComponentOnBroadcast;
|
||||
|
||||
public ?int $count = null;
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
class SslsList extends Component
|
||||
{
|
||||
use RefreshComponentOnBroadcast;
|
||||
use HasToast;
|
||||
use RefreshComponentOnBroadcast;
|
||||
|
||||
public Site $site;
|
||||
|
||||
|
@ -13,7 +13,7 @@ class Initialize extends InstallationJob
|
||||
|
||||
protected ?string $asUser;
|
||||
|
||||
public function __construct(Server $server, string $asUser = null)
|
||||
public function __construct(Server $server, ?string $asUser = null)
|
||||
{
|
||||
$this->server = $server->refresh();
|
||||
$this->asUser = $asUser;
|
||||
|
@ -233,7 +233,7 @@ public function install(): void
|
||||
// $this->team->notify(new ServerInstallationStarted($this));
|
||||
}
|
||||
|
||||
public function ssh(string $user = null): \App\Helpers\SSH|SSHFake
|
||||
public function ssh(?string $user = null): \App\Helpers\SSH|SSHFake
|
||||
{
|
||||
return SSH::init($this, $user);
|
||||
}
|
||||
@ -263,7 +263,7 @@ public function provider(): \App\Contracts\ServerProvider
|
||||
return new $providerClass($this);
|
||||
}
|
||||
|
||||
public function webserver(string $version = null): ?Service
|
||||
public function webserver(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('webserver');
|
||||
@ -272,7 +272,7 @@ public function webserver(string $version = null): ?Service
|
||||
return $this->service('webserver', $version);
|
||||
}
|
||||
|
||||
public function database(string $version = null): ?Service
|
||||
public function database(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('database');
|
||||
@ -281,7 +281,7 @@ public function database(string $version = null): ?Service
|
||||
return $this->service('database', $version);
|
||||
}
|
||||
|
||||
public function firewall(string $version = null): ?Service
|
||||
public function firewall(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('firewall');
|
||||
@ -290,7 +290,7 @@ public function firewall(string $version = null): ?Service
|
||||
return $this->service('firewall', $version);
|
||||
}
|
||||
|
||||
public function processManager(string $version = null): ?Service
|
||||
public function processManager(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('process_manager');
|
||||
@ -299,7 +299,7 @@ public function processManager(string $version = null): ?Service
|
||||
return $this->service('process_manager', $version);
|
||||
}
|
||||
|
||||
public function php(string $version = null): ?Service
|
||||
public function php(?string $version = null): ?Service
|
||||
{
|
||||
if (! $version) {
|
||||
return $this->defaultService('php');
|
||||
|
@ -33,7 +33,7 @@ public function provider(): SourceControlProvider
|
||||
return new $providerClass($this);
|
||||
}
|
||||
|
||||
public function getRepo(string $repo = null): ?array
|
||||
public function getRepo(?string $repo = null): ?array
|
||||
{
|
||||
return $this->provider()->getRepo($repo);
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ public function data(array $input): array
|
||||
/**
|
||||
* @throws CouldNotConnectToProvider
|
||||
*/
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
try {
|
||||
$this->connectToEc2ClientTest($credentials);
|
||||
|
@ -10,7 +10,7 @@ abstract class AbstractProvider implements ServerProvider
|
||||
{
|
||||
protected ?Server $server;
|
||||
|
||||
public function __construct(Server $server = null)
|
||||
public function __construct(?Server $server = null)
|
||||
{
|
||||
$this->server = $server;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public function data(array $input): array
|
||||
return [];
|
||||
}
|
||||
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public function data(array $input): array
|
||||
/**
|
||||
* @throws CouldNotConnectToProvider
|
||||
*/
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
$connect = Http::withToken($credentials['token'])->get($this->apiUrl.'/account');
|
||||
if (! $connect->ok()) {
|
||||
|
@ -45,7 +45,7 @@ public function data(array $input): array
|
||||
/**
|
||||
* @throws CouldNotConnectToProvider
|
||||
*/
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
$connect = Http::withToken($credentials['token'])->get($this->apiUrl.'/servers');
|
||||
if (! $connect->ok()) {
|
||||
|
@ -57,7 +57,7 @@ public function data(array $input): array
|
||||
/**
|
||||
* @throws CouldNotConnectToProvider
|
||||
*/
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
$connect = Http::withToken($credentials['token'])->get($this->apiUrl.'/account');
|
||||
if (! $connect->ok()) {
|
||||
|
@ -59,7 +59,7 @@ public function data(array $input): array
|
||||
/**
|
||||
* @throws CouldNotConnectToProvider
|
||||
*/
|
||||
public function connect(array $credentials = null): bool
|
||||
public function connect(?array $credentials = null): bool
|
||||
{
|
||||
$connect = Http::withToken($credentials['token'])->get($this->apiUrl.'/account');
|
||||
if (! $connect->ok()) {
|
||||
|
@ -16,7 +16,7 @@ public function __construct(Server $server)
|
||||
$this->server = $server;
|
||||
}
|
||||
|
||||
protected function progress(int $percentage, string $step = null): Closure
|
||||
protected function progress(int $percentage, ?string $step = null): Closure
|
||||
{
|
||||
return function () use ($percentage, $step) {
|
||||
$this->server->progress = $percentage;
|
||||
|
@ -47,7 +47,7 @@ public function create(
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function delete(int $id, int $siteId = null): void
|
||||
public function delete(int $id, ?int $siteId = null): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
new DeleteWorkerCommand($id),
|
||||
@ -59,7 +59,7 @@ public function delete(int $id, int $siteId = null): void
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function restart(int $id, int $siteId = null): void
|
||||
public function restart(int $id, ?int $siteId = null): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
new RestartWorkerCommand($id),
|
||||
@ -71,7 +71,7 @@ public function restart(int $id, int $siteId = null): void
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function stop(int $id, int $siteId = null): void
|
||||
public function stop(int $id, ?int $siteId = null): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
new StopWorkerCommand($id),
|
||||
@ -83,7 +83,7 @@ public function stop(int $id, int $siteId = null): void
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function start(int $id, int $siteId = null): void
|
||||
public function start(int $id, ?int $siteId = null): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
new StartWorkerCommand($id),
|
||||
|
@ -24,7 +24,7 @@ public function connect(): bool
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getRepo(string $repo = null): mixed
|
||||
public function getRepo(?string $repo = null): mixed
|
||||
{
|
||||
$res = Http::withToken($this->sourceControl->access_token)
|
||||
->get($this->apiUrl."/repositories/$repo");
|
||||
|
@ -25,7 +25,7 @@ public function connect(): bool
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getRepo(string $repo = null): mixed
|
||||
public function getRepo(?string $repo = null): mixed
|
||||
{
|
||||
if ($repo) {
|
||||
$url = $this->apiUrl.'/repos/'.$repo;
|
||||
|
@ -25,7 +25,7 @@ public function connect(): bool
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getRepo(string $repo = null): mixed
|
||||
public function getRepo(?string $repo = null): mixed
|
||||
{
|
||||
$repository = $repo ? urlencode($repo) : null;
|
||||
$res = Http::withToken($this->sourceControl->access_token)
|
||||
|
@ -15,7 +15,7 @@ class SSHFake
|
||||
|
||||
protected string $output = '';
|
||||
|
||||
public function init(Server $server, string $asUser = null): self
|
||||
public function init(Server $server, ?string $asUser = null): self
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
@ -47,7 +47,7 @@ public function assertExecuted(array|string $commands): void
|
||||
PHPUnit::assertTrue(true, $allExecuted);
|
||||
}
|
||||
|
||||
public function exec(string|array|SSHCommand $commands, string $log = '', int $siteId = null): string
|
||||
public function exec(string|array|SSHCommand $commands, string $log = '', ?int $siteId = null): string
|
||||
{
|
||||
if (! is_array($commands)) {
|
||||
$commands = [$commands];
|
||||
|
Reference in New Issue
Block a user