Skip to content

Commit

Permalink
Split condition into multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed May 5, 2023
1 parent 2cf98ff commit 6f8c4e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/models/RecurringScheduleModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ public function canSendNow(SendoutElement $sendout): bool
return true;
}

// N: Numeric representation of the day of the week: 1 to 7
if ($this->frequencyInterval == 'weeks' && !empty($this->daysOfWeek[$now->format('N')]) && ($this->frequency == 1 || floor($diff->d / 7) % $this->frequency == 0)) {
// N: Numeric representation of the day of the week (1 to 7)
if ($this->frequencyInterval == 'weeks'
&& !empty($this->daysOfWeek[$now->format('N')])
&& ($this->frequency == 1 || floor($diff->d / 7) % $this->frequency == 0)
) {
return true;
}

// j: Numeric representation of the day of the month: 1 to 31
if ($this->frequencyInterval == 'months' && !empty($this->daysOfMonth[$now->format('j')]) && ($this->frequency == 1 || $diff->m % $this->frequency == 0)) {
// j: Numeric representation of the day of the month (1 to 31)
if ($this->frequencyInterval == 'months'
&& !empty($this->daysOfMonth[$now->format('j')])
&& ($this->frequency == 1 || $diff->m % $this->frequency == 0)
) {
return true;
}

Expand Down

0 comments on commit 6f8c4e5

Please sign in to comment.