From 77cb0af587e5ec04e2eeedb6d250662728dbf094 Mon Sep 17 00:00:00 2001 From: Oleg Kasyanov Date: Tue, 11 Jun 2024 15:31:01 +0400 Subject: [PATCH] Code optimization --- src/Image.php | 2 +- src/ImageOptions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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