mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
refactoring
This commit is contained in:
@ -2,17 +2,16 @@
|
||||
|
||||
namespace App\SSHCommands\Firewall;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait CommandContent
|
||||
{
|
||||
public function content(string $os): string
|
||||
public function content(): string
|
||||
{
|
||||
$command = Str::replace('__type__', $this->type, $this->file($os));
|
||||
$command = Str::replace('__protocol__', $this->protocol, $command);
|
||||
$command = Str::replace('__source__', $this->source, $command);
|
||||
$command = Str::replace('__mask__', $this->mask, $command);
|
||||
|
||||
return Str::replace('__port__', $this->port, $command);
|
||||
return str($this->file())
|
||||
->replace('__type__', $this->type)
|
||||
->replace('__protocol__', $this->protocol)
|
||||
->replace('__source__', $this->source)
|
||||
->replace('__mask__', $this->mask || $this->mask == 0 ? '/'.$this->mask : '')
|
||||
->replace('__port__', $this->port)
|
||||
->toString();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user