From 33a4e2276ca8e65fac191588bc0cfe95a4d10712 Mon Sep 17 00:00:00 2001 From: Yoan-Alexander Grigorov Date: Wed, 5 Mar 2025 13:46:38 +0100 Subject: [PATCH] Explicit nullable types --- src/Version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Version.php b/src/Version.php index 89dfe5f..21c538a 100644 --- a/src/Version.php +++ b/src/Version.php @@ -31,7 +31,7 @@ class Version implements JsonSerializable protected static ?Comparator $comparator = null; - final protected function __construct(int $major, int $minor, int $patch, PreRelease $preRelease = null, Build $build = null) + final protected function __construct(int $major, int $minor, int $patch, ?PreRelease $preRelease = null, ?Build $build = null) { VersionAssert::that($major)->greaterOrEqualThan(0, 'Major version must be positive integer'); VersionAssert::that($minor)->greaterOrEqualThan(0, 'Minor version must be positive integer'); @@ -44,7 +44,7 @@ final protected function __construct(int $major, int $minor, int $patch, PreRele $this->build = $build; } - public static function from(int $major, int $minor = 0, int $patch = 0, PreRelease $preRelease = null, Build $build = null): Version + public static function from(int $major, int $minor = 0, int $patch = 0, ?PreRelease $preRelease = null, ?Build $build = null): Version { return new static($major, $minor, $patch, $preRelease, $build); }