-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(caldav): add repair steps in sabre calendarobject change hook #42347
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
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
| // 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
|
|
||
| public function onCalendarObjectChange(?VCalendar $oldVCalendar, ?VCalendar $newVCalendar, bool &$modified): void { | ||
| $keyedOldComponents = []; | ||
| foreach ($oldVCalendar->children() as $child) { |
Check notice
Code scanning / Psalm
PossiblyNullReference
| if (!($child instanceof Component)) { | ||
| continue; | ||
| } | ||
| $keyedOldComponents[$child->UID] = $child; |
Check notice
Code scanning / Psalm
PossiblyNullArrayOffset
|
|
||
| class Plugin extends ServerPlugin { | ||
|
|
||
| private Server $server; |
Check notice
Code scanning / Psalm
PropertyNotSetInConstructor
| } | ||
|
|
||
| public function registerRepairStep(string $repairStep): self { | ||
| $this->addRepairStep(new $repairStep); |
Check notice
Code scanning / Psalm
InvalidStringClass
| } | ||
|
|
||
| public function registerRepairStep(string $repairStep): self { | ||
| $this->addRepairStep(new $repairStep); |
Check notice
Code scanning / Psalm
ArgumentTypeCoercion
Summary
Introduce a middleware repair step for calendar data before it's being saved or updated.
TODO
Checklist