Skip to content

Apply rector changes#60102

Merged
sorbaugh merged 1 commit into
masterfrom
automated/noid/rector-changes
May 28, 2026
Merged

Apply rector changes#60102
sorbaugh merged 1 commit into
masterfrom
automated/noid/rector-changes

Conversation

@nextcloud-command
Copy link
Copy Markdown
Contributor

Automated changes by create-pull-request GitHub action

@nextcloud-command nextcloud-command added 3. to review Waiting for reviews technical debt 🧱 🤔🚀 labels May 3, 2026
@nextcloud-command nextcloud-command requested a review from a team as a code owner May 3, 2026 14:49
@nextcloud-command nextcloud-command requested review from Altahrim, artonge, leftybournes and salmart-dev and removed request for a team May 3, 2026 14:50
@joshtrichards joshtrichards force-pushed the automated/noid/rector-changes branch from c8c295b to ddb51d9 Compare May 5, 2026 14:29
@joshtrichards
Copy link
Copy Markdown
Member

This is a broader issue that I suspect came from some other psalm changes:

Error: apps/appstore/tests/Controller/PageControllerTest.php:25:3: InvalidDocblock: Attribute arguments must be named. (see https://psalm.dev/008)

We likely don't want to use named arguments for these; phpunit discourages it and it's unnecesary.

@nextcloud-command nextcloud-command force-pushed the automated/noid/rector-changes branch from ddb51d9 to 842c4f5 Compare May 10, 2026 14:50
@nextcloud-command nextcloud-command force-pushed the automated/noid/rector-changes branch from 842c4f5 to 33c009d Compare May 17, 2026 14:51
Signed-off-by: GitHub <noreply@github.com>
@nextcloud-command nextcloud-command force-pushed the automated/noid/rector-changes branch from 33c009d to fd14234 Compare May 24, 2026 14:56
@sorbaugh sorbaugh merged commit 4cad192 into master May 28, 2026
197 of 200 checks passed
@sorbaugh sorbaugh deleted the automated/noid/rector-changes branch May 28, 2026 10:31
Comment on lines 332 to 857
@@ -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);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The events have also been deprecated for long enough.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants