@@ -43,7 +43,7 @@ |
||
| 43 | 43 | private $cardMapper; |
| 44 | 44 | |
| 45 | 45 | public function __construct(ActivityManager $activityManager, CardMapper $cardMapper) { |
| 46 | - $this->activityManager = $activityManager; |
|
| 46 | + $this->activityManager = $activityManager; |
|
| 47 | 47 | $this->cardMapper = $cardMapper; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | * @param CommentsEvent $event |
| 51 | 51 | */ |
| 52 | 52 | public function handle(CommentsEvent $event) { |
| 53 | - if($event->getComment()->getObjectType() !== 'deckCard') { |
|
| 53 | + if ($event->getComment()->getObjectType() !== 'deckCard') { |
|
| 54 | 54 | return; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $eventType = $event->getEvent(); |
| 58 | - if( $eventType === CommentsEvent::EVENT_ADD |
|
| 58 | + if ($eventType === CommentsEvent::EVENT_ADD |
|
| 59 | 59 | ) { |
| 60 | 60 | $this->notificationHandler($event); |
| 61 | 61 | $this->activityHandler($event); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $applicableEvents = [ |
| 66 | 66 | CommentsEvent::EVENT_UPDATE |
| 67 | 67 | ]; |
| 68 | - if(in_array($eventType, $applicableEvents)) { |
|
| 68 | + if (in_array($eventType, $applicableEvents)) { |
|
| 69 | 69 | $this->notificationHandler($event); |
| 70 | 70 | return; |
| 71 | 71 | } |
@@ -26,10 +26,8 @@ |
||
| 26 | 26 | |
| 27 | 27 | use OCA\Deck\StatusException; |
| 28 | 28 | use OCP\AppFramework\ApiController; |
| 29 | -use OCP\AppFramework\Http; |
|
| 30 | 29 | use OCP\AppFramework\Http\DataResponse; |
| 31 | 30 | use OCP\IRequest; |
| 32 | - |
|
| 33 | 31 | use OCA\Deck\Service\BoardService; |
| 34 | 32 | use Sabre\HTTP\Util; |
| 35 | 33 | |
@@ -95,6 +95,9 @@ discard block |
||
| 95 | 95 | $this->cardMapper->markNotified($card); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | + /** |
|
| 99 | + * @param \OCA\Deck\Db\Card $card |
|
| 100 | + */ |
|
| 98 | 101 | public function markDuedateAsRead($card) { |
| 99 | 102 | $notification = $this->notificationManager->createNotification(); |
| 100 | 103 | $notification |
@@ -104,6 +107,9 @@ discard block |
||
| 104 | 107 | $this->notificationManager->markProcessed($notification); |
| 105 | 108 | } |
| 106 | 109 | |
| 110 | + /** |
|
| 111 | + * @param \OCA\Deck\Db\Card $card |
|
| 112 | + */ |
|
| 107 | 113 | public function sendCardAssigned($card, $userId) { |
| 108 | 114 | $boardId = $this->cardMapper->findBoardId($card->getId()); |
| 109 | 115 | $board = $this->getBoard($boardId); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | * DeckProvider constructor. |
| 78 | 78 | * |
| 79 | 79 | * @param IL10N $l10n |
| 80 | - * @param IUrlGenerator $urlGenerator |
|
| 80 | + * @param IURLGenerator $urlGenerator |
|
| 81 | 81 | * @param FullTextSearchService $fullTextSearchService |
| 82 | 82 | */ |
| 83 | 83 | public function __construct( |
@@ -240,7 +240,7 @@ |
||
| 240 | 240 | foreach ($searchResult->getDocuments() as $document) { |
| 241 | 241 | try { |
| 242 | 242 | $board = |
| 243 | - $this->fullTextSearchService->getBoardFromCardId((int)$document->getId()); |
|
| 243 | + $this->fullTextSearchService->getBoardFromCardId((int) $document->getId()); |
|
| 244 | 244 | $path = '#!/board/' . $board->getId() . '//card/' . $document->getId(); |
| 245 | 245 | $document->setLink($this->urlGenerator->linkToRoute('deck.page.index') . $path); |
| 246 | 246 | } catch (DoesNotExistException $e) { |
@@ -44,7 +44,6 @@ |
||
| 44 | 44 | use OCP\FullTextSearch\Model\ISearchResult; |
| 45 | 45 | use OCP\FullTextSearch\Model\ISearchTemplate; |
| 46 | 46 | use OCP\IL10N; |
| 47 | -use OCP\IURLGenerator; |
|
| 48 | 47 | |
| 49 | 48 | |
| 50 | 49 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $boardLabels = $this->labelMapper->findAll($boardId); |
| 96 | 96 | if (\is_array($boardLabels)) { |
| 97 | - foreach($boardLabels as $boardLabel) { |
|
| 97 | + foreach ($boardLabels as $boardLabel) { |
|
| 98 | 98 | if ($boardLabel->getTitle() === $title) { |
| 99 | 99 | throw new BadRequestException('title must be unique'); |
| 100 | 100 | break; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $boardLabels = $this->labelMapper->findAll($label->getBoardId()); |
| 170 | 170 | if (\is_array($boardLabels)) { |
| 171 | - foreach($boardLabels as $boardLabel) { |
|
| 171 | + foreach ($boardLabels as $boardLabel) { |
|
| 172 | 172 | if ($boardLabel->getId() === $label->getId()) { |
| 173 | 173 | continue; |
| 174 | 174 | } |
@@ -55,7 +55,6 @@ |
||
| 55 | 55 | /** |
| 56 | 56 | * Get the type of a resource |
| 57 | 57 | * |
| 58 | - * @param IResource $resource |
|
| 59 | 58 | * @return string |
| 60 | 59 | * @since 15.0.0 |
| 61 | 60 | */ |
@@ -25,7 +25,6 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | use OCA\Deck\Db\Acl; |
| 28 | -use OCA\Deck\Db\Board; |
|
| 29 | 28 | use OCA\Deck\Db\BoardMapper; |
| 30 | 29 | use OCA\Deck\Service\PermissionService; |
| 31 | 30 | use OCP\AppFramework\Db\DoesNotExistException; |
@@ -34,7 +33,6 @@ discard block |
||
| 34 | 33 | use OCP\Collaboration\Resources\IManager; |
| 35 | 34 | use OCP\Collaboration\Resources\IProvider; |
| 36 | 35 | use OCP\Collaboration\Resources\IResource; |
| 37 | -use OCP\Collaboration\Resources\ResourceException; |
|
| 38 | 36 | use OCP\IUser; |
| 39 | 37 | |
| 40 | 38 | class ResourceProvider implements IProvider { |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | } catch (QueryException $e) { |
| 125 | 125 | } |
| 126 | 126 | if ($boardId !== null) { |
| 127 | - $resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string)$boardId, null); |
|
| 127 | + $resource = $resourceManager->getResourceForUser(self::RESOURCE_TYPE, (string) $boardId, null); |
|
| 128 | 128 | $resourceManager->invalidateAccessCacheForResource($resource); |
| 129 | 129 | } else { |
| 130 | 130 | $resourceManager->invalidateAccessCacheForProvider($this); |
@@ -53,6 +53,9 @@ |
||
| 53 | 53 | $this->addResolvable('participant'); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 56 | 59 | public function getPermission($permission) { |
| 57 | 60 | switch ($permission) { |
| 58 | 61 | case self::PERMISSION_READ: |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | 159 | * @param $boardId |
| 160 | - * @return bool |
|
| 160 | + * @return boolean|null |
|
| 161 | 161 | */ |
| 162 | 162 | public function userIsBoardOwner($boardId, $userId = null) { |
| 163 | 163 | if ($userId === null) { |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | use OCP\AppFramework\Db\DoesNotExistException; |
| 34 | 34 | use OCP\AppFramework\Db\Entity; |
| 35 | 35 | use OCP\AppFramework\Db\MultipleObjectsReturnedException; |
| 36 | -use OCP\AppFramework\QueryException; |
|
| 37 | 36 | use OCP\IConfig; |
| 38 | 37 | use OCP\IGroupManager; |
| 39 | 38 | use OCP\ILogger; |