-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(caldav): add repair steps in sabre calendarobject change hook #42347
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Thomas Citharel <[email protected]>
// Compare descriptions | ||
$isSameDescription = (string) $oldObject->DESCRIPTION === (string) $newObject->DESCRIPTION; | ||
$isSameXAltDesc = (string) $oldObject->{self::X_ALT_DESC_PROP_NAME} === (string) $newObject->{self::X_ALT_DESC_PROP_NAME}; | ||
$isSameAltRep = (string) $oldObject->DESCRIPTION['ALTREP'] === (string) $newObject->DESCRIPTION['ALTREP']; |
Check failure
Code scanning / Psalm
InvalidCast Error
// Compare descriptions | ||
$isSameDescription = (string) $oldObject->DESCRIPTION === (string) $newObject->DESCRIPTION; | ||
$isSameXAltDesc = (string) $oldObject->{self::X_ALT_DESC_PROP_NAME} === (string) $newObject->{self::X_ALT_DESC_PROP_NAME}; | ||
$isSameAltRep = (string) $oldObject->DESCRIPTION['ALTREP'] === (string) $newObject->DESCRIPTION['ALTREP']; |
Check failure
Code scanning / Psalm
InvalidCast Error
|
||
public function onCalendarObjectChange(?VCalendar $oldVCalendar, ?VCalendar $newVCalendar, bool &$modified): void { | ||
$keyedOldComponents = []; | ||
foreach ($oldVCalendar->children() as $child) { |
Check notice
Code scanning / Psalm
PossiblyNullReference Note
if (!($child instanceof Component)) { | ||
continue; | ||
} | ||
$keyedOldComponents[$child->UID] = $child; |
Check notice
Code scanning / Psalm
PossiblyNullArrayOffset Note
|
||
class Plugin extends ServerPlugin { | ||
|
||
private Server $server; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor Note
} | ||
|
||
public function registerRepairStep(string $repairStep): self { | ||
$this->addRepairStep(new $repairStep); |
Check notice
Code scanning / Psalm
InvalidStringClass Note
} | ||
|
||
public function registerRepairStep(string $repairStep): self { | ||
$this->addRepairStep(new $repairStep); |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion Note
Summary
Introduce a middleware repair step for calendar data before it's being saved or updated.
TODO
Checklist