fix(dav): Move DAV app to non deprecated event dispatcher#39190
fix(dav): Move DAV app to non deprecated event dispatcher#39190
Conversation
| }); | ||
|
|
||
|
|
||
| $dispatcher->addListener('\OCA\DAV\CalDAV\CalDavBackend::updateShares', function (GenericEvent $event) use ($container) { |
There was a problem hiding this comment.
| $dispatcher->addListener('\OCP\Calendar\Resource\ForceRefreshEvent', $eventHandler); | ||
| $dispatcher->addListener('\OCP\Calendar\Room\ForceRefreshEvent', $eventHandler); |
There was a problem hiding this comment.
I could not find ForceRefreshEvent as a search term in our github org, apart from this occurance here. I assume there were plans that changed on the way, so I think this is dead code and I just remove it.
| }); | ||
|
|
||
| $dispatcher->addListener('OC\AccountManager::userUpdated', function (GenericEvent $event) use ($container) { | ||
| $dispatcher->addListener('OC\AccountManager::userUpdated', function ($event) use ($container) { |
There was a problem hiding this comment.
what type is the event now? can it be hinted?
There was a problem hiding this comment.
Still GenericEvent, but then Psalm complains because the event listener does not consume IEvent. Removing silences psalm and makes it work. The actual fix again is creating and only listening to typed events, but time....
Signed-off-by: Joas Schilling <coding@schilljs.com>
The legacy event was removed in 4bb31c0 Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
a4939c0 to
e1d4b82
Compare
| $syncService = $container->query(SyncService::class); | ||
| $syncService->updateUser($user); | ||
| $dispatcher->addListener('OC\AccountManager::userUpdated', function ($event) use ($container) { | ||
| if ($event instanceof GenericEvent) { |
Check notice
Code scanning / Psalm
DocblockTypeContradiction
| if ($event instanceof GenericEvent) { | ||
| $user = $event->getSubject(); | ||
| /** @var SyncService $syncService */ | ||
| $syncService = $container->query(SyncService::class); |
Check notice
Code scanning / Psalm
DeprecatedMethod
One step closer for #38546
Checklist