From 0b6a90e903f57f2fb0802beae24fb6ed99831aa0 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 12 Apr 2024 17:46:59 +0200 Subject: [PATCH] explicitly mark nullable parameters as nullable (#175) --- src/Cron/CronExpression.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cron/CronExpression.php b/src/Cron/CronExpression.php index 216ce43..7f0dab0 100644 --- a/src/Cron/CronExpression.php +++ b/src/Cron/CronExpression.php @@ -148,7 +148,7 @@ public static function getAliases(): array /** * @deprecated since version 3.0.2, use __construct instead. */ - public static function factory(string $expression, FieldFactoryInterface $fieldFactory = null): CronExpression + public static function factory(string $expression, ?FieldFactoryInterface $fieldFactory = null): CronExpression { /** @phpstan-ignore-next-line */ return new static($expression, $fieldFactory); @@ -179,7 +179,7 @@ public static function isValidExpression(string $expression): bool * @param null|FieldFactoryInterface $fieldFactory Factory to create cron fields * @throws InvalidArgumentException */ - public function __construct(string $expression, FieldFactoryInterface $fieldFactory = null) + public function __construct(string $expression, ?FieldFactoryInterface $fieldFactory = null) { $shortcut = strtolower($expression); $expression = self::$registeredAliases[$shortcut] ?? $expression;