Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: dartcafe <[email protected]>
  • Loading branch information
dartcafe committed Aug 4, 2023
1 parent 4b12e92 commit a224c7c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/Controller/PollApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function transferPolls(string $sourceUser, string $destinationUser): JSON
* @param int $pollId Poll to transfer
* @param string $destinationUser User to transfer the poll to
*/
public function transferPoll(string $pollId, string $destinationUser): JSONResponse {
public function transferPoll(int $pollId, string $destinationUser): JSONResponse {
try {
return new JSONResponse(['transferred' => $this->pollService->transferPoll($pollId, $destinationUser)], Http::STATUS_CREATED);
} catch (Exception $e) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/ShareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function list(int $pollId): JSONResponse {
* Add share
* @NoAdminRequired
*/
public function add(int $pollId, string $type, string $userId = '', string $displayName = '', string $emailAddress = '' ): JSONResponse {
public function add(int $pollId, string $type, string $userId = '', string $displayName = '', string $emailAddress = ''): JSONResponse {
return $this->responseCreate(fn () => ['share' => $this->shareService->add($pollId, $type, $userId, $displayName, $emailAddress)]);
}

Expand Down
1 change: 0 additions & 1 deletion lib/Controller/SubscriptionApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use OCA\Polls\Exceptions\Exception;
use OCA\Polls\Model\Acl;
use OCA\Polls\Service\SubscriptionService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
Expand Down
6 changes: 1 addition & 5 deletions lib/Service/OptionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function confirm(int $optionId): Option {
return $this->option;
}

private function getModifiedDateOption(Option $option, DateTimeZone $timeZone, int $step, string $unit) {
private function getModifiedDateOption(Option $option, DateTimeZone $timeZone, int $step, string $unit): array {
$from = (new DateTime())
->setTimestamp($option->getTimestamp())
->setTimezone($timeZone)
Expand All @@ -266,10 +266,6 @@ private function getModifiedDateOption(Option $option, DateTimeZone $timeZone, i
];
}

private function cloneOption() {
return clone $this->option;
}

/**
* Make a sequence of date poll options
*
Expand Down
2 changes: 0 additions & 2 deletions lib/Service/PollService.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public function transferPolls(string $sourceUser, string $targetUser): array {

/**
* @return Poll
*
* @psalm-return array<Poll>
*/
public function transferPoll(int $pollId, string $targetUser): Poll {
if ($this->userManager->get($targetUser) instanceof IUser) {
Expand Down

0 comments on commit a224c7c

Please sign in to comment.