Skip to content

Commit

Permalink
fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine Di Gruttola committed Sep 12, 2023
1 parent 2afc8a4 commit 2b6034f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Entity/ImageSliderLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ public function setDescription(string $description): ImageSliderLang
}

/**
* @return string
* @return string|null
*/
public function getImage(): string
public function getImage(): ?string
{
return $this->image;
}
Expand All @@ -199,9 +199,9 @@ public function setImage(string $image): ImageSliderLang
}

/**
* @return string
* @return string|null
*/
public function getImageMobile(): string
public function getImageMobile(): ?string
{
return $this->imageMobile;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Form/DataHandler/ImageSliderFormDataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ public function update($id, array $data): int
->setDescription($data['description'][$langId] ?? '');

if (!empty($data['image'][$langId])) {
if (!$newImageSliderLang) {
if ($imageSliderLang->getImage() !== null) {
$this->eraseFile($imageSliderLang->getImage());
}
$imageSliderLang->setImage($this->uploadFile($data['image'][$langId]));
}

if (!empty($data['image_mobile'][$langId])) {
if (!$newImageSliderLang) {
if ($imageSliderLang->getImage() !== null) {
$this->eraseFile($imageSliderLang->getImageMobile());
}
$imageSliderLang->setImageMobile($this->uploadFile($data['image_mobile'][$langId]));
Expand Down

0 comments on commit 2b6034f

Please sign in to comment.