chore: add phpstan static analysis minimum (#4511)
This commit is contained in:
parent
3f7e2a565f
commit
a1a52754ad
67 changed files with 561 additions and 279 deletions
|
@ -98,17 +98,17 @@ class InitiateBackupService
|
|||
// Get the oldest backup the server has that is not "locked" (indicating a backup that should
|
||||
// never be automatically purged). If we find a backup we will delete it and then continue with
|
||||
// this process. If no backup is found that can be used an exception is thrown.
|
||||
/** @var \Pterodactyl\Models\Backup $oldest */
|
||||
$oldest = $successful->where('is_locked', false)->orderBy('created_at')->first();
|
||||
if (!$oldest) {
|
||||
throw new TooManyBackupsException($server->backup_limit);
|
||||
}
|
||||
|
||||
/* @var Backup $oldest */
|
||||
$this->deleteBackupService->handle($oldest);
|
||||
}
|
||||
|
||||
return $this->connection->transaction(function () use ($server, $name) {
|
||||
/** @var \Pterodactyl\Models\Backup $backup */
|
||||
/** @var Backup $backup */
|
||||
$backup = $this->repository->create([
|
||||
'server_id' => $server->id,
|
||||
'uuid' => Uuid::uuid4()->toString(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue