Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion lib/Sharing/DeckShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OCP\IL10N;
use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IAttributes;
use OCP\Share\IManager;
use OCP\Share\IShare;

Expand Down Expand Up @@ -150,7 +151,12 @@
)
);*/

// set share attributes
$shareAttributes = $this->formatShareAttributes(

Check failure on line 155 in lib/Sharing/DeckShareProvider.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedMethod

lib/Sharing/DeckShareProvider.php:155:29: UndefinedMethod: Method OCA\Deck\Sharing\DeckShareProvider::formatShareAttributes does not exist (see https://psalm.dev/022)
$share->getAttributes()
);

$shareId = $this->addShareToDB(

Check failure on line 159 in lib/Sharing/DeckShareProvider.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

TooManyArguments

lib/Sharing/DeckShareProvider.php:159:21: TooManyArguments: Too many arguments for method OCA\Deck\Sharing\DeckShareProvider::addsharetodb - saw 10 (see https://psalm.dev/026)
$share->getSharedWith(),
$share->getSharedBy(),
$share->getShareOwner(),
Expand All @@ -159,7 +165,8 @@
$share->getTarget(),
$share->getPermissions(),
$share->getToken() ?? '',
$share->getExpirationDate()
$share->getExpirationDate(),
$shareAttributes
);
$data = $this->getRawShare($shareId);

Expand All @@ -180,6 +187,7 @@
* @param int $permissions
* @param string $token
* @param \DateTime|null $expirationDate
* @param string|null $attributes
* @return int
*/
private function addShareToDB(
Expand Down Expand Up @@ -211,6 +219,10 @@
$qb->setValue('expiration', $qb->createNamedParameter($expirationDate, 'datetime'));
}

if ($attributes !== null) {

Check failure on line 222 in lib/Sharing/DeckShareProvider.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedVariable

lib/Sharing/DeckShareProvider.php:222:7: UndefinedVariable: Cannot find referenced variable $attributes (see https://psalm.dev/024)
$qb->setValue('attributes', $qb->createNamedParameter($attributes));
}

$qb->executeStatement();

return $qb->getLastInsertId();
Expand Down Expand Up @@ -281,6 +293,9 @@
$entryData['parent'] = $entryData['f_parent'];
$share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, $this->mimeTypeLoader));
}

$share = $this->updateShareAttributes($share, $data['attributes'] ?? null);

Check failure on line 297 in lib/Sharing/DeckShareProvider.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedMethod

lib/Sharing/DeckShareProvider.php:297:19: UndefinedMethod: Method OCA\Deck\Sharing\DeckShareProvider::updateShareAttributes does not exist (see https://psalm.dev/022)

return $share;
}

Expand Down
Loading