diff --git a/src/Recurr/DateUtil.php b/src/Recurr/DateUtil.php index 48a4e87..d53ed5e 100644 --- a/src/Recurr/DateUtil.php +++ b/src/Recurr/DateUtil.php @@ -111,8 +111,8 @@ public static function getDateInfo(\DateTimeInterface $dt) public static function getDaySetOfWeek( \DateTimeInterface $dt, \DateTimeInterface $start, - Rule $rule = null, - DateInfo $dtInfo = null + ?Rule $rule = null, + ?DateInfo $dtInfo = null ) { $start = clone $dt; diff --git a/src/Recurr/Recurrence.php b/src/Recurr/Recurrence.php index 48ab117..736d3bb 100644 --- a/src/Recurr/Recurrence.php +++ b/src/Recurr/Recurrence.php @@ -27,7 +27,7 @@ class Recurrence /** @var int */ protected $index; - public function __construct(\DateTimeInterface $start = null, \DateTimeInterface $end = null, $index = 0) + public function __construct(?\DateTimeInterface $start = null, ?\DateTimeInterface $end = null, $index = 0) { if ($start instanceof \DateTimeInterface) { $this->setStart($start); diff --git a/src/Recurr/Transformer/ArrayTransformer.php b/src/Recurr/Transformer/ArrayTransformer.php index 414a3e6..06a5026 100644 --- a/src/Recurr/Transformer/ArrayTransformer.php +++ b/src/Recurr/Transformer/ArrayTransformer.php @@ -52,7 +52,7 @@ class ArrayTransformer * * @param ArrayTransformerConfig $config */ - public function __construct(ArrayTransformerConfig $config = null) + public function __construct(?ArrayTransformerConfig $config = null) { if (!$config instanceof ArrayTransformerConfig) { $config = new ArrayTransformerConfig(); @@ -83,7 +83,7 @@ public function setConfig($config) * @return RecurrenceCollection|Recurrence[] * @throws InvalidWeekday */ - public function transform(Rule $rule, ConstraintInterface $constraint = null, $countConstraintFailures = true) + public function transform(Rule $rule, ?ConstraintInterface $constraint = null, $countConstraintFailures = true) { $start = $rule->getStartDate(); $end = $rule->getEndDate(); diff --git a/src/Recurr/Transformer/TextTransformer.php b/src/Recurr/Transformer/TextTransformer.php index 0fdef0b..2b7dd2d 100644 --- a/src/Recurr/Transformer/TextTransformer.php +++ b/src/Recurr/Transformer/TextTransformer.php @@ -9,7 +9,7 @@ class TextTransformer protected $fragments = array(); protected $translator; - public function __construct(TranslatorInterface $translator = null) + public function __construct(?TranslatorInterface $translator = null) { $this->translator = $translator ?: new Translator('en'); }