diff --git a/src/Image.php b/src/Image.php index 2b53e8b..9fab344 100644 --- a/src/Image.php +++ b/src/Image.php @@ -103,7 +103,7 @@ private function setLetterCase(string $string, string $fontName): string */ private function prepareFontsList(): array { - $list = glob(realpath($this->imageOptions->getFontsFolder()) . DIRECTORY_SEPARATOR . '*.ttf'); + $list = glob($this->imageOptions->getFontsFolder() . DIRECTORY_SEPARATOR . '*.ttf'); if ([] === $list || false === $list) { throw new LogicException('The specified folder does not contain any fonts.'); diff --git a/src/ImageOptions.php b/src/ImageOptions.php index 0e71e5b..d13d495 100644 --- a/src/ImageOptions.php +++ b/src/ImageOptions.php @@ -90,7 +90,7 @@ public function setFontsFolder(string|Stringable $folder): self public function getFontsFolder(): string { - return realpath($this->fontsFolder); + return (string) realpath($this->fontsFolder); } public function setFontShuffle(bool $shuffle): self