Skip to content

Conversation

@backportbot
Copy link

@backportbot backportbot bot commented Nov 15, 2024

Backport of PR #48833

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@backportbot backportbot bot requested review from miaulalala and st3iny November 15, 2024 06:50
@backportbot backportbot bot added bug 3. to review Waiting for reviews feature: caldav Related to CalDAV internals labels Nov 15, 2024
@backportbot backportbot bot added this to the Nextcloud 30.0.3 milestone Nov 15, 2024
// calculate time differnce from now to start of event
$occuring = $this->minimizeInterval($this->timeFactory->getDateTime()->diff($er->recurrenceDate()));
// calculate time difference from now to start of event
$occurring = $this->minimizeInterval($this->timeFactory->getDateTime()->diff($er->recurrenceDate()));

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of DateTime::diff cannot be null, possibly null value provided
// In 2 days/weeks/months/years on July 1, 2024 between 8:00 AM - 9:00 AM (America/Toronto)
return match ([($occurring[0] > 1), !empty($endTime)]) {
[false, false] => $this->l10n->t('In a %1$s on %2$s for the entire day', [$occurring[1], $startDate]),
[false, true] => $this->l10n->t('In a %1$s on %2$s between %3$s - %4$s', [$occurring[1], $startDate, $startTime, $endTime]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $startTime, first seen on line 207
// In 2 days/weeks/months/years on July 1, 2024 between 8:00 AM - 9:00 AM (America/Toronto)
return match ([($occurring[0] > 1), !empty($endTime)]) {
[false, false] => $this->l10n->t('In a %1$s on %2$s for the entire day', [$occurring[1], $startDate]),
[false, true] => $this->l10n->t('In a %1$s on %2$s between %3$s - %4$s', [$occurring[1], $startDate, $startTime, $endTime]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $endTime, first seen on line 209
[false, false] => $this->l10n->t('In a %1$s on %2$s for the entire day', [$occurring[1], $startDate]),
[false, true] => $this->l10n->t('In a %1$s on %2$s between %3$s - %4$s', [$occurring[1], $startDate, $startTime, $endTime]),
[true, false] => $this->l10n->t('In %1$s %2$s on %3$s for the entire day', [$occurring[0], $occurring[1], $startDate]),
[true, true] => $this->l10n->t('In %1$s %2$s on %3$s between %4$s - %5$s', [$occurring[0], $occurring[1], $startDate, $startTime, $endTime]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $startTime, first seen on line 207
[false, false] => $this->l10n->t('In a %1$s on %2$s for the entire day', [$occurring[1], $startDate]),
[false, true] => $this->l10n->t('In a %1$s on %2$s between %3$s - %4$s', [$occurring[1], $startDate, $startTime, $endTime]),
[true, false] => $this->l10n->t('In %1$s %2$s on %3$s for the entire day', [$occurring[0], $occurring[1], $startDate]),
[true, true] => $this->l10n->t('In %1$s %2$s on %3$s between %4$s - %5$s', [$occurring[0], $occurring[1], $startDate, $startTime, $endTime]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $endTime, first seen on line 209
return match ([($occurrenceIn[0] > 1), !empty($occurrence2), !empty($occurrence3)]) {
[false, false, false] => $this->l10n->t('In a %1$s on %2$s', [$occurrenceIn[1], $occurrence]),
[false, true, false] => $this->l10n->t('In a %1$s on %2$s then on %3$s', [$occurrenceIn[1], $occurrence, $occurrence2]),
[false, true, true] => $this->l10n->t('In a %1$s on %2$s then on %3$s and %4$s', [$occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $occurrence2, first seen on line 545
return match ([($occurrenceIn[0] > 1), !empty($occurrence2), !empty($occurrence3)]) {
[false, false, false] => $this->l10n->t('In a %1$s on %2$s', [$occurrenceIn[1], $occurrence]),
[false, true, false] => $this->l10n->t('In a %1$s on %2$s then on %3$s', [$occurrenceIn[1], $occurrence, $occurrence2]),
[false, true, true] => $this->l10n->t('In a %1$s on %2$s then on %3$s and %4$s', [$occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $occurrence3, first seen on line 551
[false, true, false] => $this->l10n->t('In a %1$s on %2$s then on %3$s', [$occurrenceIn[1], $occurrence, $occurrence2]),
[false, true, true] => $this->l10n->t('In a %1$s on %2$s then on %3$s and %4$s', [$occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),
[true, false, false] => $this->l10n->t('In %1$s %2$s on %3$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence]),
[true, true, false] => $this->l10n->t('In %1$s %2$s on %3$s then on %4$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence, $occurrence2]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $occurrence2, first seen on line 545
[false, true, true] => $this->l10n->t('In a %1$s on %2$s then on %3$s and %4$s', [$occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),
[true, false, false] => $this->l10n->t('In %1$s %2$s on %3$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence]),
[true, true, false] => $this->l10n->t('In %1$s %2$s on %3$s then on %4$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence, $occurrence2]),
[true, true, true] => $this->l10n->t('In %1$s %2$s on %3$s then on %4$s and %5$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $occurrence2, first seen on line 545
[false, true, true] => $this->l10n->t('In a %1$s on %2$s then on %3$s and %4$s', [$occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),
[true, false, false] => $this->l10n->t('In %1$s %2$s on %3$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence]),
[true, true, false] => $this->l10n->t('In %1$s %2$s on %3$s then on %4$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence, $occurrence2]),
[true, true, true] => $this->l10n->t('In %1$s %2$s on %3$s then on %4$s and %5$s', [$occurrenceIn[0], $occurrenceIn[1], $occurrence, $occurrence2, $occurrence3]),

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $occurrence3, first seen on line 551
@SebastianKrupinski SebastianKrupinski merged commit 2f65ffd into stable30 Nov 15, 2024
@SebastianKrupinski SebastianKrupinski deleted the backport/48833/stable30 branch November 15, 2024 12:49
@skjnldsv skjnldsv mentioned this pull request Nov 27, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug feature: caldav Related to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants