From 09225604c0b37882af4ebce278ff667003f3eb0d Mon Sep 17 00:00:00 2001 From: Anton Komarev Date: Sun, 1 Mar 2026 14:03:01 +0300 Subject: [PATCH] Fix types definition --- src/FontFace.php | 5 ++--- src/FontList.php | 5 ++--- src/Glyph.php | 4 ++-- src/MissingGlyph.php | 5 ++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/FontFace.php b/src/FontFace.php index d05820b..0f4c4ca 100644 --- a/src/FontFace.php +++ b/src/FontFace.php @@ -9,7 +9,6 @@ final class FontFace private const DEFAULT_UNITS_PER_EM = 1000; public function __construct( - public readonly int | null $unitsPerEm = self::DEFAULT_UNITS_PER_EM, - ) { - } + public readonly ?int $unitsPerEm = self::DEFAULT_UNITS_PER_EM, + ) {} } diff --git a/src/FontList.php b/src/FontList.php index 4a20e49..427458d 100644 --- a/src/FontList.php +++ b/src/FontList.php @@ -14,8 +14,7 @@ final class FontList */ private function __construct( private readonly array $fontList, - ) { - } + ) {} /** * @param list $fontList @@ -38,7 +37,7 @@ public static function of( public static function ofFile( string $filePath, - SvgFontFileParserInterface $fontFileParser = null, + ?SvgFontFileParserInterface $fontFileParser = null, ): self { if ($fontFileParser === null) { $fontFileParser = new SimpleXmlSvgFontFileParser(); diff --git a/src/Glyph.php b/src/Glyph.php index 92f97ec..7c545b2 100644 --- a/src/Glyph.php +++ b/src/Glyph.php @@ -10,8 +10,8 @@ final class Glyph { public function __construct( public readonly Character $character, - public readonly string | null $name = null, - public readonly int | null $horizontalAdvance = null, + public readonly ?string $name = null, + public readonly ?int $horizontalAdvance = null, ) { if ($horizontalAdvance !== null && $horizontalAdvance < 0) { throw new \InvalidArgumentException( diff --git a/src/MissingGlyph.php b/src/MissingGlyph.php index 85e61a6..54327f6 100644 --- a/src/MissingGlyph.php +++ b/src/MissingGlyph.php @@ -7,7 +7,6 @@ final class MissingGlyph { public function __construct( - public readonly int | null $horizontalAdvance = null, - ) { - } + public readonly ?int $horizontalAdvance = null, + ) {} }