Skip to content

Commit

Permalink
fix: RiskyTruthyFalsyComparison
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed May 31, 2024
1 parent 73fb85b commit 7e64905
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/files_sharing/lib/Command/FixBrokenShares.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public function execute(InputInterface $input, OutputInterface $output): int {
if ($this->orphanHelper->isShareValid($share['owner'], $share['fileid']) || !$this->orphanHelper->fileExists($share['fileid'])) {
continue;
}
if ($owner = $this->orphanHelper->findOwner($share['fileid'])) {

$owner = $this->orphanHelper->findOwner($share['fileid']);

if (!empty($owner)) {

Check notice

Code scanning / Psalm

RiskyTruthyFalsyComparison Note

Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead.
$this->orphanHelper->updateShareOwner($share['id'], $owner);
$output->writeln("Share {$share['id']} updated to owner $owner");
}
Expand Down

0 comments on commit 7e64905

Please sign in to comment.