Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
parent
95e15d2c8a
commit
cbcf62086f
573 changed files with 4387 additions and 9411 deletions
|
@ -13,47 +13,22 @@ use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
|
|||
|
||||
class ServerDeletionService
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $force = false;
|
||||
protected bool $force = false;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Database\ConnectionInterface
|
||||
*/
|
||||
private $connection;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Repositories\Wings\DaemonServerRepository
|
||||
*/
|
||||
private $daemonServerRepository;
|
||||
|
||||
/**
|
||||
* @var \Pterodactyl\Services\Databases\DatabaseManagementService
|
||||
*/
|
||||
private $databaseManagementService;
|
||||
|
||||
/**
|
||||
* DeletionService constructor.
|
||||
* ServerDeletionService constructor.
|
||||
*/
|
||||
public function __construct(
|
||||
ConnectionInterface $connection,
|
||||
DaemonServerRepository $daemonServerRepository,
|
||||
DatabaseManagementService $databaseManagementService
|
||||
private ConnectionInterface $connection,
|
||||
private DaemonServerRepository $daemonServerRepository,
|
||||
private DatabaseManagementService $databaseManagementService
|
||||
) {
|
||||
$this->connection = $connection;
|
||||
$this->daemonServerRepository = $daemonServerRepository;
|
||||
$this->databaseManagementService = $databaseManagementService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the server should be forcibly deleted from the panel (ignoring daemon errors) or not.
|
||||
*
|
||||
* @param bool $bool
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function withForce($bool = true)
|
||||
public function withForce(bool $bool = true): self
|
||||
{
|
||||
$this->force = $bool;
|
||||
|
||||
|
@ -66,7 +41,7 @@ class ServerDeletionService
|
|||
* @throws \Throwable
|
||||
* @throws \Pterodactyl\Exceptions\DisplayException
|
||||
*/
|
||||
public function handle(Server $server)
|
||||
public function handle(Server $server): void
|
||||
{
|
||||
try {
|
||||
$this->daemonServerRepository->setServer($server)->delete();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue