@@ -147,7 +147,7 @@ |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
| 150 | - * @return array |
|
| 150 | + * @return integer |
|
| 151 | 151 | */ |
| 152 | 152 | private function getBoardPrerequisites() { |
| 153 | 153 | $groups = $this->groupManager->getUserGroupIds( |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public function findAll($since = 0) { |
| 88 | 88 | $userInfo = $this->getBoardPrerequisites(); |
| 89 | 89 | $userBoards = $this->boardMapper->findAllByUser($userInfo['user'], null, null, $since); |
| 90 | - $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'],null, null, $since); |
|
| 90 | + $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups'], null, null, $since); |
|
| 91 | 91 | $complete = array_merge($userBoards, $groupBoards); |
| 92 | 92 | $result = []; |
| 93 | 93 | foreach ($complete as &$item) { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function find($boardId) { |
| 123 | 123 | |
| 124 | - if ( is_numeric($boardId) === false ) { |
|
| 124 | + if (is_numeric($boardId) === false) { |
|
| 125 | 125 | throw new BadRequestException('board id must be a number'); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function isArchived($mapper, $id) { |
| 172 | 172 | |
| 173 | - if (is_numeric($id) === false) { |
|
| 173 | + if (is_numeric($id) === false) { |
|
| 174 | 174 | throw new BadRequestException('id must be a number'); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | throw new BadRequestException('mapper must be provided'); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - if (is_numeric($id) === false) { |
|
| 207 | + if (is_numeric($id) === false) { |
|
| 208 | 208 | throw new BadRequestException('id must be a number'); |
| 209 | 209 | } |
| 210 | 210 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | * @throws BadRequestException |
| 333 | 333 | */ |
| 334 | 334 | public function deleteForce($id) { |
| 335 | - if (is_numeric($id) === false) { |
|
| 335 | + if (is_numeric($id) === false) { |
|
| 336 | 336 | throw new BadRequestException('id must be a number'); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | throw new BadRequestException('color must be provided'); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if ( is_bool($archived) === false ) { |
|
| 369 | + if (is_bool($archived) === false) { |
|
| 370 | 370 | throw new BadRequestException('archived must be a boolean'); |
| 371 | 371 | } |
| 372 | 372 | |
@@ -31,10 +31,10 @@ |
||
| 31 | 31 | use OCA\Deck\Service\CardService; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * Class BoardApiController |
|
| 35 | - * |
|
| 36 | - * @package OCA\Deck\Controller |
|
| 37 | - */ |
|
| 34 | + * Class BoardApiController |
|
| 35 | + * |
|
| 36 | + * @package OCA\Deck\Controller |
|
| 37 | + */ |
|
| 38 | 38 | class CardApiController extends ApiController { |
| 39 | 39 | private $cardService; |
| 40 | 40 | private $userId; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | private function enrichStackWithCards($stack, $since = -1) { |
| 78 | 78 | $cards = $this->cardMapper->findAll($stack->getId(), null, null, $since); |
| 79 | 79 | |
| 80 | - if(\count($cards) === 0) { |
|
| 80 | + if (\count($cards) === 0) { |
|
| 81 | 81 | return; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function delete($id) { |
| 218 | 218 | |
| 219 | - if ( is_numeric($id) === false ) { |
|
| 219 | + if (is_numeric($id) === false) { |
|
| 220 | 220 | throw new BadRequestException('stack id must be a number'); |
| 221 | 221 | } |
| 222 | 222 | |
@@ -23,13 +23,9 @@ |
||
| 23 | 23 | |
| 24 | 24 | namespace OCA\Deck\Db; |
| 25 | 25 | |
| 26 | -use OCP\AppFramework\Db\DoesNotExistException; |
|
| 27 | -use OCP\ICache; |
|
| 28 | 26 | use OCP\ICacheFactory; |
| 29 | 27 | use OCP\IDBConnection; |
| 30 | 28 | use OCP\IRequest; |
| 31 | -use OCP\IUserManager; |
|
| 32 | -use OCP\IGroupManager; |
|
| 33 | 29 | |
| 34 | 30 | class ChangeHelper { |
| 35 | 31 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function cardChanged($cardId, $updateCard = true) { |
| 60 | 60 | $time = time(); |
| 61 | 61 | $etag = md5($time . microtime()); |
| 62 | - $this->cache->set(self::TYPE_CARD . '-' .$cardId, $etag); |
|
| 62 | + $this->cache->set(self::TYPE_CARD . '-' . $cardId, $etag); |
|
| 63 | 63 | if ($updateCard) { |
| 64 | 64 | $sql = 'UPDATE `*PREFIX*deck_cards` SET `last_modified` = ? WHERE `id` = ?'; |
| 65 | 65 | $this->db->executeUpdate($sql, [time(), $cardId]); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function stackChanged($stackId, $updateBoard = true) { |
| 77 | 77 | $time = time(); |
| 78 | 78 | $etag = md5($time . microtime()); |
| 79 | - $this->cache->set(self::TYPE_CARD . '-' .$stackId, $etag); |
|
| 79 | + $this->cache->set(self::TYPE_CARD . '-' . $stackId, $etag); |
|
| 80 | 80 | if ($updateBoard) { |
| 81 | 81 | $sql = 'UPDATE `*PREFIX*deck_stacks` SET `last_modified` = ? WHERE `id` = ?'; |
| 82 | 82 | $this->db->executeUpdate($sql, [time(), $stackId]); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | public function getEtag($type, $id) { |
| 95 | - $entry = $this->cache->get($type . '-' .$id); |
|
| 95 | + $entry = $this->cache->get($type . '-' . $id); |
|
| 96 | 96 | if ($entry === 'null') { |
| 97 | 97 | return ''; |
| 98 | 98 | } |