code style fix

add command tests
This commit is contained in:
Saeed Vaziry
2023-09-02 16:41:42 +02:00
parent 71f9dabc24
commit e1eb42059f
135 changed files with 1859 additions and 135 deletions

View File

@ -13,7 +13,7 @@ public function __construct(protected string $provider, protected string $databa
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/backup.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/backup.sh', $this->provider)));
}
public function content(): string

View File

@ -13,7 +13,7 @@ public function __construct(protected string $provider, protected string $name)
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/create.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/create.sh', $this->provider)));
}
public function content(): string

View File

@ -17,7 +17,7 @@ public function __construct(
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/create-user.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/create-user.sh', $this->provider)));
}
public function content(): string

View File

@ -13,7 +13,7 @@ public function __construct(protected string $provider, protected string $name)
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/delete.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/delete.sh', $this->provider)));
}
public function content(): string

View File

@ -13,7 +13,7 @@ public function __construct(protected string $provider, protected string $userna
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/delete-user.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/delete-user.sh', $this->provider)));
}
public function content(): string

View File

@ -17,7 +17,7 @@ public function __construct(
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/link.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/link.sh', $this->provider)));
}
public function content(): string

View File

@ -13,7 +13,7 @@ public function __construct(protected string $provider, protected string $databa
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/restore.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/restore.sh', $this->provider)));
}
public function content(): string

View File

@ -16,7 +16,7 @@ public function __construct(
public function file(): string
{
return File::get(resource_path(sprintf("commands/database/%s/unlink.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/database/%s/unlink.sh', $this->provider)));
}
public function content(): string

View File

@ -21,6 +21,6 @@ public function __construct(
public function file(): string
{
return File::get(resource_path(sprintf("commands/firewall/%s/add-rule.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/firewall/%s/add-rule.sh', $this->provider)));
}
}

View File

@ -21,6 +21,6 @@ public function __construct(
public function file(): string
{
return File::get(resource_path(sprintf("commands/firewall/%s/remove-rule.sh", $this->provider)));
return File::get(resource_path(sprintf('commands/firewall/%s/remove-rule.sh', $this->provider)));
}
}

View File

@ -4,7 +4,6 @@
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class InstallNginxCommand extends Command
{

View File

@ -4,7 +4,6 @@
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class InstallPHPCommand extends Command
{

View File

@ -4,7 +4,6 @@
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
class UninstallPHPCommand extends Command
{

View File

@ -5,7 +5,7 @@
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
class DeleteNginxPHPMyAdminVHost extends Command
class DeleteNginxPHPMyAdminVHostCommand extends Command
{
public function __construct(protected string $path)
{

View File

@ -17,6 +17,6 @@ public function file(): string
public function content(): string
{
return 'sudo rm -rf '.$this->path.'*'."\n";
return 'sudo rm -rf '.$this->path.'*';
}
}

View File

@ -5,7 +5,7 @@
use App\SSHCommands\Command;
use Illuminate\Support\Facades\File;
class RunScript extends Command
class RunScriptCommand extends Command
{
public function __construct(protected string $path, protected string $script)
{
@ -20,7 +20,7 @@ public function content(): string
{
return str($this->file())
->replace('__path__', $this->path)
->replace('__script__', make_bash_script($this->script))
->replace('__script__', $this->script)
->toString();
}
}