Skip to content

Commit bd17e2a

Browse files
committed
fix PHP8 warnings
1 parent 3438934 commit bd17e2a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Image.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,11 @@ private function convertPosX($posX, int $width = 0): int
380380
case static::ALIGN_LEFT:
381381
return 0;
382382
case static::ALIGN_CENTER:
383-
return \round($this->width / 2 - $width / 2);
383+
return $this->width / 2 - $width / 2;
384384
case static::ALIGN_RIGHT:
385385
return $this->width - $width;
386386
}
387-
return $posX;
387+
return \round($posX);
388388
}
389389

390390
/**
@@ -400,11 +400,11 @@ private function convertPosY($posY, int $height = 0): int
400400
case static::ALIGN_TOP:
401401
return 0;
402402
case static::ALIGN_MIDDLE:
403-
return \round($this->height / 2 - $height / 2);
403+
return $this->height / 2 - $height / 2;
404404
case static::ALIGN_BOTTOM:
405405
return $this->height - $height;
406406
}
407-
return $posY;
407+
return \round($posY);
408408
}
409409

410410
//===============================================================================================================================
@@ -772,7 +772,7 @@ public function setOpacity(float $opacity): Image
772772

773773
\imagealphablending($this->image, false);
774774
\imagesavealpha($this->image, true);
775-
\imagefilter($this->image, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * (1 - $opacity));
775+
\imagefilter($this->image, IMG_FILTER_COLORIZE, 0, 0, 0, \round(127 * (1 - $opacity)));
776776

777777
return $this;
778778
}

0 commit comments

Comments
 (0)