Skip to content

Commit

Permalink
Merge pull request #216 from slevomat/path-php84
Browse files Browse the repository at this point in the history
Fix compatibility with PHP 8.4
  • Loading branch information
simshaun authored Dec 12, 2024
2 parents 1aff62e + f9c2cf2 commit b023b06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Recurr/DateUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Recurr/Recurrence.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Recurr/Transformer/ArrayTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/Recurr/Transformer/TextTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit b023b06

Please sign in to comment.