Apply rector changes#60102
Conversation
c8c295b to
ddb51d9
Compare
|
This is a broader issue that I suspect came from some other psalm changes:
We likely don't want to use named arguments for these; phpunit discourages it and it's unnecesary. |
ddb51d9 to
842c4f5
Compare
842c4f5 to
33c009d
Compare
Signed-off-by: GitHub <noreply@github.com>
33c009d to
fd14234
Compare
| @@ -436,7 +434,7 @@ public function update($id, array $data) { | |||
| // path can still be null if the file doesn't exist | |||
| if ($path !== null) { | |||
| $event = new CacheEntryUpdatedEvent($this->storage, $path, $id, $this->getNumericStorageId()); | |||
| $this->eventDispatcher->dispatch(CacheUpdateEvent::class, $event); | |||
| $this->eventDispatcher->dispatch(CacheEntryUpdatedEvent::class, $event); | |||
| $this->eventDispatcher->dispatchTyped($event); | |||
| } | |||
| } | |||
| @@ -850,11 +848,11 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { | |||
| $this->eventDispatcher->dispatchTyped(new CacheEntriesRemovedEvent([$event])); | |||
|
|
|||
| $event = new CacheEntryInsertedEvent($this->storage, $targetPath, $sourceId, $this->getNumericStorageId()); | |||
| $this->eventDispatcher->dispatch(CacheInsertEvent::class, $event); | |||
| $this->eventDispatcher->dispatch(CacheEntryInsertedEvent::class, $event); | |||
| $this->eventDispatcher->dispatchTyped($event); | |||
| } else { | |||
| $event = new CacheEntryUpdatedEvent($this->storage, $targetPath, $sourceId, $this->getNumericStorageId()); | |||
| $this->eventDispatcher->dispatch(CacheUpdateEvent::class, $event); | |||
| $this->eventDispatcher->dispatch(CacheEntryUpdatedEvent::class, $event); | |||
| $this->eventDispatcher->dispatchTyped($event); | |||
| } | |||
There was a problem hiding this comment.
I believe these changes to be incorrect.
Either the old name is listened to and we cannot change the dispatch, or it’s not and we can remove the dispatch. There is the dispatchTyped already that will dispatch the new name.
There was a problem hiding this comment.
Right, I overlooked that. Apparently only Collectives listens to these events, so the easiest solution is to fix Collectives and then remove these event emit calls here:
https://github.com/search?q=org%3ANextcloud+CacheInsertEvent%3A%3Aclass&type=code
https://github.com/search?q=org%3ANextcloud+CacheUpdateEvent%3A%3Aclass&type=code
There was a problem hiding this comment.
The events have also been deprecated for long enough.
Automated changes by create-pull-request GitHub action