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
|
@ -11,10 +11,8 @@ class TaskRepository extends EloquentRepository implements TaskRepositoryInterfa
|
|||
{
|
||||
/**
|
||||
* Return the model backing this repository.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function model()
|
||||
public function model(): string
|
||||
{
|
||||
return Task::class;
|
||||
}
|
||||
|
@ -28,20 +26,18 @@ class TaskRepository extends EloquentRepository implements TaskRepositoryInterfa
|
|||
{
|
||||
try {
|
||||
return $this->getBuilder()->with('server.user', 'schedule')->findOrFail($id, $this->getColumns());
|
||||
} catch (ModelNotFoundException $exception) {
|
||||
} catch (ModelNotFoundException) {
|
||||
throw new RecordNotFoundException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next task in a schedule.
|
||||
*
|
||||
* @return \Pterodactyl\Models\Task|null
|
||||
*/
|
||||
public function getNextTask(int $schedule, int $index)
|
||||
public function getNextTask(int $schedule, int $index): ?Task
|
||||
{
|
||||
return $this->getBuilder()->where('schedule_id', '=', $schedule)
|
||||
->orderBy('sequence_id', 'asc')
|
||||
->orderBy('sequence_id')
|
||||
->where('sequence_id', '>', $index)
|
||||
->first($this->getColumns());
|
||||
}
|
||||
|
|
Reference in a new issue