Skip to content

Commit

Permalink
👌 Fix warnings for upcoming PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoverbruggen committed Nov 16, 2021
1 parent 5c84fe6 commit 8e04d64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Helpers/ColorHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public static function randomHex(): string
*/
public static function contrastColor($hex): string
{
if ($hex == null) {
$hex = "#000000";
}

// Remove the # to avoid errors
$hex = str_replace('#', '', $hex);

Expand Down
4 changes: 2 additions & 2 deletions src/ImageGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public function generate($text = "", $path = null, $size = null, $bgHex = null,
imagestring(
$imageResource,
$fontSize,
$x,
$y,
(int) $x,
(int) $y,
$text,
$allocatedFgColor
);
Expand Down

0 comments on commit 8e04d64

Please sign in to comment.