Skip to content

Conversation

@artonge
Copy link
Contributor

@artonge artonge commented Nov 30, 2023

No description provided.

@artonge artonge self-assigned this Nov 30, 2023
@artonge artonge added 3. to review Waiting for reviews technical debt php Pull requests that update Php code feature: files labels Nov 30, 2023
@artonge artonge added this to the Nextcloud 29 milestone Nov 30, 2023
$this->handleDeletion($event, $peerFile);
} elseif ($event instanceof CacheEntryRemovedEvent) {
$peerFile->delete();
} elseif ($event instanceof BeforeNodeRestoredEvent) {

Check failure

Code scanning / Psalm

RedundantCondition

Type OCA\Files_Trashbin\Events\BeforeNodeRestoredEvent for $event is always OCA\Files_Trashbin\Events\BeforeNodeRestoredEvent
if (!str_ends_with($targetName, ".".$sourceExtension)) {
$event->abortOperation(new NotPermittedException("Cannot change the extension of a live photo"));
}
$this->handleMove($event, $peerFile);

Check notice

Code scanning / Psalm

ArgumentTypeCoercion

Argument 2 of OCA\Files\Listener\SyncLivePhotosListener::handleMove expects OCP\Files\File, but parent type OCP\Files\Node provided
}
$this->handleMove($event, $peerFile);
} elseif ($event instanceof BeforeNodeDeletedEvent) {
$this->handleDeletion($event, $peerFile);

Check notice

Code scanning / Psalm

ArgumentTypeCoercion

Argument 2 of OCA\Files\Listener\SyncLivePhotosListener::handleDeletion expects OCP\Files\File, but parent type OCP\Files\Node provided
} elseif ($event instanceof CacheEntryRemovedEvent) {
$peerFile->delete();
} elseif ($event instanceof BeforeNodeRestoredEvent) {
$this->handleRestore($event, $peerFile);

Check notice

Code scanning / Psalm

ArgumentTypeCoercion

Argument 2 of OCA\Files\Listener\SyncLivePhotosListener::handleRestore expects OCP\Files\File, but parent type OCP\Files\Node provided
$event->abortOperation(new NotPermittedException("Cannot restore the video part of a live photo"));
}
} else {
$user = $this->userSession->getUser();

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getUser on possibly null value
@artonge artonge force-pushed the artonge/debt/comment_sync_live_photos branch from a80f5f4 to e6bc34c Compare November 30, 2023 12:00
@artonge
Copy link
Contributor Author

artonge commented Nov 30, 2023

/backport to stable28

@artonge artonge merged commit e0d1e7c into master Nov 30, 2023
@artonge artonge deleted the artonge/debt/comment_sync_live_photos branch November 30, 2023 16:33
@blizzz blizzz mentioned this pull request Mar 5, 2024
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 feature: files php Pull requests that update Php code technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants