Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -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();