mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 10:51:36 +00:00
27 lines
574 B
PHP
Executable File
27 lines
574 B
PHP
Executable File
<?php
|
|
|
|
namespace App\ServerTypes;
|
|
|
|
use App\Contracts\ServerType;
|
|
use App\Models\Server;
|
|
use Closure;
|
|
|
|
abstract class AbstractType implements ServerType
|
|
{
|
|
protected Server $server;
|
|
|
|
public function __construct(Server $server)
|
|
{
|
|
$this->server = $server;
|
|
}
|
|
|
|
protected function progress(int $percentage, ?string $step = null): Closure
|
|
{
|
|
return function () use ($percentage, $step) {
|
|
$this->server->progress = $percentage;
|
|
$this->server->progress_step = $step;
|
|
$this->server->save();
|
|
};
|
|
}
|
|
}
|