mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 16:02:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -29,7 +29,7 @@ public function deletionRules(): array
|
||||
{
|
||||
return [
|
||||
'service' => [
|
||||
function (string $attribute, mixed $value, Closure $fail) {
|
||||
function (string $attribute, mixed $value, Closure $fail): void {
|
||||
$hasSite = $this->service->server->sites()
|
||||
->where('php_version', $this->service->version)
|
||||
->exists();
|
||||
@ -88,7 +88,7 @@ public function setDefaultCli(): void
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function installExtension($name): void
|
||||
public function installExtension(string $name): void
|
||||
{
|
||||
$result = $this->service->server->ssh()->exec(
|
||||
view('ssh.services.php.install-php-extension', [
|
||||
@ -97,7 +97,11 @@ public function installExtension($name): void
|
||||
]),
|
||||
'install-php-extension-'.$name
|
||||
);
|
||||
$result = Str::substr($result, strpos($result, '[PHP Modules]'));
|
||||
$pos = strpos($result, '[PHP Modules]');
|
||||
if ($pos === false) {
|
||||
throw new SSHCommandError('Failed to install extension');
|
||||
}
|
||||
$result = Str::substr($result, $pos);
|
||||
if (! Str::contains($result, $name)) {
|
||||
throw new SSHCommandError('Failed to install extension');
|
||||
}
|
||||
@ -127,7 +131,7 @@ public function getPHPIni(string $type): string
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function createFpmPool(string $user, string $version, $site_id): void
|
||||
public function createFpmPool(string $user, string $version): void
|
||||
{
|
||||
$this->service->server->ssh()->write(
|
||||
"/etc/php/{$version}/fpm/pool.d/{$user}.conf",
|
||||
@ -144,7 +148,7 @@ public function createFpmPool(string $user, string $version, $site_id): void
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function removeFpmPool(string $user, string $version, $site_id): void
|
||||
public function removeFpmPool(string $user, string $version, ?int $siteId): void
|
||||
{
|
||||
$this->service->server->ssh()->exec(
|
||||
view('ssh.services.php.remove-fpm-pool', [
|
||||
@ -152,7 +156,7 @@ public function removeFpmPool(string $user, string $version, $site_id): void
|
||||
'version' => $version,
|
||||
]),
|
||||
"remove-{$version}fpm-pool-{$user}",
|
||||
$site_id
|
||||
$siteId
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user