@@ -24,12 +24,9 @@ |
||
| 24 | 24 | |
| 25 | 25 | namespace OCA\Deck\Controller; |
| 26 | 26 | |
| 27 | -use OCA\Deck\Db\ChangeHelper; |
|
| 28 | 27 | use OCP\AppFramework\ApiController; |
| 29 | -use OCP\AppFramework\Http; |
|
| 30 | 28 | use OCP\AppFramework\Http\DataResponse; |
| 31 | 29 | use OCP\IRequest; |
| 32 | - |
|
| 33 | 30 | use OCA\Deck\Service\BoardService; |
| 34 | 31 | |
| 35 | 32 | /** |
@@ -23,9 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | namespace OCA\Deck\Controller; |
| 25 | 25 | |
| 26 | - use OCA\Deck\Db\ChangeHelper; |
|
| 27 | 26 | use OCP\AppFramework\ApiController; |
| 28 | - use OCP\AppFramework\Http; |
|
| 29 | 27 | use OCP\AppFramework\Http\DataResponse; |
| 30 | 28 | use OCP\IRequest; |
| 31 | 29 | use OCA\Deck\Service\CardService; |
@@ -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; |
@@ -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 | |
@@ -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 | |