X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/4d399f6ba77610635d4d1399b9ac3d5302c63b9c..refs/pull/4467/head:/app/Entities/Repos/ChapterRepo.php diff --git a/app/Entities/Repos/ChapterRepo.php b/app/Entities/Repos/ChapterRepo.php index dadeec7f8..977193d85 100644 --- a/app/Entities/Repos/ChapterRepo.php +++ b/app/Entities/Repos/ChapterRepo.php @@ -16,14 +16,9 @@ use Exception; class ChapterRepo { - protected $baseRepo; - - /** - * ChapterRepo constructor. - */ - public function __construct(BaseRepo $baseRepo) - { - $this->baseRepo = $baseRepo; + public function __construct( + protected BaseRepo $baseRepo + ) { } /** @@ -49,7 +44,7 @@ class ChapterRepo { $chapter = new Chapter(); $chapter->book_id = $parentBook->id; - $chapter->priority = $chapter->priority ?: (new BookContents($parentBook))->getLastPriority() + 1; + $chapter->priority = (new BookContents($parentBook))->getLastPriority() + 1; $this->baseRepo->create($chapter, $input); Activity::add(ActivityType::CHAPTER_CREATE, $chapter);