1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Worked towards phpstan level 2, 13 errors remain

This commit is contained in:
Dan Brown
2022-10-24 12:12:48 +01:00
parent 45d0860448
commit 2a65331573
9 changed files with 31 additions and 27 deletions

View File

@ -87,14 +87,14 @@ class BaseRepo
{
if ($coverImage) {
$imageType = $entity->coverImageTypeKey();
$this->imageRepo->destroyImage($entity->cover);
$this->imageRepo->destroyImage($entity->cover()->first());
$image = $this->imageRepo->saveNew($coverImage, $imageType, $entity->id, 512, 512, true);
$entity->cover()->associate($image);
$entity->save();
}
if ($removeImage) {
$this->imageRepo->destroyImage($entity->cover);
$this->imageRepo->destroyImage($entity->cover()->first());
$entity->image_id = 0;
$entity->save();
}