@@ -99,16 +99,16 @@  | 
                                                    ||
| 99 | 99 | $data = [];  | 
                                                        
| 100 | 100 |  		foreach ($boards as $board) { | 
                                                        
| 101 | 101 | $fullBoard = $this->boardMapper->find($board->getId(), true, true);  | 
                                                        
| 102 | - $data[$board->getId()] = (array)$fullBoard->jsonSerialize();  | 
                                                        |
| 102 | + $data[$board->getId()] = (array) $fullBoard->jsonSerialize();  | 
                                                        |
| 103 | 103 | $stacks = $this->stackMapper->findAll($board->getId());  | 
                                                        
| 104 | 104 |  			foreach ($stacks as $stack) { | 
                                                        
| 105 | - $data[$board->getId()]['stacks'][] = (array)$stack->jsonSerialize();  | 
                                                        |
| 105 | + $data[$board->getId()]['stacks'][] = (array) $stack->jsonSerialize();  | 
                                                        |
| 106 | 106 | $cards = $this->cardMapper->findAllByStack($stack->getId());  | 
                                                        
| 107 | 107 |  				foreach ($cards as $card) { | 
                                                        
| 108 | 108 | $fullCard = $this->cardMapper->find($card->getId());  | 
                                                        
| 109 | 109 | $assignedUsers = $this->assignedUsersMapper->find($card->getId());  | 
                                                        
| 110 | 110 | $fullCard->setAssignedUsers($assignedUsers);  | 
                                                        
| 111 | - $data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array)$fullCard->jsonSerialize();  | 
                                                        |
| 111 | + $data[$board->getId()]['stacks'][$stack->getId()]['cards'][] = (array) $fullCard->jsonSerialize();  | 
                                                        |
| 112 | 112 | }  | 
                                                        
| 113 | 113 | }  | 
                                                        
| 114 | 114 | }  | 
                                                        
@@ -85,7 +85,7 @@ discard block  | 
                                                    ||
| 85 | 85 | * @throws NotPermittedException  | 
                                                        
| 86 | 86 | */  | 
                                                        
| 87 | 87 |  	private function getFolder(Attachment $attachment) { | 
                                                        
| 88 | - $folderName = 'file-card-' . (int)$attachment->getCardId();  | 
                                                        |
| 88 | + $folderName = 'file-card-' . (int) $attachment->getCardId();  | 
                                                        |
| 89 | 89 |  		try { | 
                                                        
| 90 | 90 | $folder = $this->appData->getFolder($folderName);  | 
                                                        
| 91 | 91 |  		} catch (NotFoundException $e) { | 
                                                        
@@ -116,7 +116,7 @@ discard block  | 
                                                    ||
| 116 | 116 | * @return array  | 
                                                        
| 117 | 117 | * @throws StatusException  | 
                                                        
| 118 | 118 | */  | 
                                                        
| 119 | -	private function getUploadedFile () { | 
                                                        |
| 119 | +	private function getUploadedFile() { | 
                                                        |
| 120 | 120 |  		$file = $this->request->getUploadedFile('file'); | 
                                                        
| 121 | 121 | $error = null;  | 
                                                        
| 122 | 122 | $phpFileUploadErrors = [  | 
                                                        
@@ -190,7 +190,7 @@ discard block  | 
                                                    ||
| 190 | 190 | * @throws \Exception  | 
                                                        
| 191 | 191 | */  | 
                                                        
| 192 | 192 |  	private function getFileFromRootFolder(Attachment $attachment) { | 
                                                        
| 193 | - $folderName = 'file-card-' . (int)$attachment->getCardId();  | 
                                                        |
| 193 | + $folderName = 'file-card-' . (int) $attachment->getCardId();  | 
                                                        |
| 194 | 194 |  		$instanceId = $this->config->getSystemValue('instanceid', null); | 
                                                        
| 195 | 195 |  		if ($instanceId === null) { | 
                                                        
| 196 | 196 |  			throw new \Exception('no instance id!'); | 
                                                        
@@ -32,10 +32,10 @@  | 
                                                    ||
| 32 | 32 | use OCA\Deck\Controller\Helper\ApiHelper;  | 
                                                        
| 33 | 33 | |
| 34 | 34 | /**  | 
                                                        
| 35 | - * Class BoardApiController  | 
                                                        |
| 36 | - *  | 
                                                        |
| 37 | - * @package OCA\Deck\Controller  | 
                                                        |
| 38 | - */  | 
                                                        |
| 35 | + * Class BoardApiController  | 
                                                        |
| 36 | + *  | 
                                                        |
| 37 | + * @package OCA\Deck\Controller  | 
                                                        |
| 38 | + */  | 
                                                        |
| 39 | 39 |  class LabelApiController extends ApiController { | 
                                                        
| 40 | 40 | |
| 41 | 41 | private $labelService;  | 
                                                        
@@ -67,14 +67,14 @@ discard block  | 
                                                    ||
| 67 | 67 | |
| 68 | 68 | $cursor = $qb->execute();  | 
                                                        
| 69 | 69 | $row = $cursor->fetch(PDO::FETCH_ASSOC);  | 
                                                        
| 70 | -		if($row === false) { | 
                                                        |
| 70 | +		if ($row === false) { | 
                                                        |
| 71 | 71 | $cursor->closeCursor();  | 
                                                        
| 72 | 72 |  			throw new DoesNotExistException('Did expect one result but found none when executing' . $qb); | 
                                                        
| 73 | 73 | }  | 
                                                        
| 74 | 74 | |
| 75 | 75 | $row2 = $cursor->fetch();  | 
                                                        
| 76 | 76 | $cursor->closeCursor();  | 
                                                        
| 77 | -		if($row2 !== false ) { | 
                                                        |
| 77 | +		if ($row2 !== false) { | 
                                                        |
| 78 | 78 |  			throw new MultipleObjectsReturnedException('Did not expect more than one result when executing' . $query); | 
                                                        
| 79 | 79 | }  | 
                                                        
| 80 | 80 | |
@@ -97,7 +97,7 @@ discard block  | 
                                                    ||
| 97 | 97 | |
| 98 | 98 | $entities = [];  | 
                                                        
| 99 | 99 | $cursor = $qb->execute();  | 
                                                        
| 100 | -		while($row = $cursor->fetch()){ | 
                                                        |
| 100 | +		while ($row = $cursor->fetch()) { | 
                                                        |
| 101 | 101 | $entities[] = $this->mapRowToEntity($row);  | 
                                                        
| 102 | 102 | }  | 
                                                        
| 103 | 103 | $cursor->closeCursor();  | 
                                                        
@@ -127,7 +127,7 @@ discard block  | 
                                                    ||
| 127 | 127 | |
| 128 | 128 | $entities = [];  | 
                                                        
| 129 | 129 | $cursor = $qb->execute();  | 
                                                        
| 130 | -		while($row = $cursor->fetch()){ | 
                                                        |
| 130 | +		while ($row = $cursor->fetch()) { | 
                                                        |
| 131 | 131 | $entities[] = $this->mapRowToEntity($row);  | 
                                                        
| 132 | 132 | }  | 
                                                        
| 133 | 133 | $cursor->closeCursor();  | 
                                                        
@@ -112,6 +112,6 @@  | 
                                                    ||
| 112 | 112 |  		['name' => 'attachment_api#delete', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}', 'verb' => 'DELETE'], | 
                                                        
| 113 | 113 |  		['name' => 'attachment_api#restore', 'url' => '/api/v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}/restore', 'verb' => 'PUT'], | 
                                                        
| 114 | 114 | |
| 115 | -		['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}','verb' => 'OPTIONS', 'requirements' => ['path' => '.+']], | 
                                                        |
| 115 | +		['name' => 'board_api#preflighted_cors', 'url' => '/api/v1.0/{path}', 'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']], | 
                                                        |
| 116 | 116 | ]  | 
                                                        
| 117 | 117 | ];  | 
                                                        
@@ -91,8 +91,8 @@  | 
                                                    ||
| 91 | 91 | $card->setLabels($this->labelMapper->findAssignedLabelsForCard($cardId));  | 
                                                        
| 92 | 92 | $card->setAttachmentCount($this->attachmentService->count($cardId));  | 
                                                        
| 93 | 93 | $user = $this->userManager->get($this->currentUser);  | 
                                                        
| 94 | -		$lastRead = $this->commentsManager->getReadMark('deckCard', (string)$card->getId(), $user); | 
                                                        |
| 95 | -		$count = $this->commentsManager->getNumberOfCommentsForObject('deckCard', (string)$card->getId(), $lastRead); | 
                                                        |
| 94 | +		$lastRead = $this->commentsManager->getReadMark('deckCard', (string) $card->getId(), $user); | 
                                                        |
| 95 | +		$count = $this->commentsManager->getNumberOfCommentsForObject('deckCard', (string) $card->getId(), $lastRead); | 
                                                        |
| 96 | 96 | $card->setCommentsUnread($count);  | 
                                                        
| 97 | 97 | }  | 
                                                        
| 98 | 98 | |
@@ -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 | * Assign a user to a card  | 
                                                        
| 148 | 148 | */  | 
                                                        
| 149 | 149 |  	public function assignUser($userId) { | 
                                                        
| 150 | -		$card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId);; | 
                                                        |
| 150 | +		$card = $this->cardService->assignUser($this->request->getParam('cardId'), $userId); ; | 
                                                        |
| 151 | 151 | return new DataResponse($card, HTTP::STATUS_OK);  | 
                                                        
| 152 | 152 | }  | 
                                                        
| 153 | 153 | |
@@ -31,76 +31,76 @@  | 
                                                    ||
| 31 | 31 | |
| 32 | 32 |  class AttachmentApiController extends ApiController { | 
                                                        
| 33 | 33 | |
| 34 | - private $attachmentService;  | 
                                                        |
| 34 | + private $attachmentService;  | 
                                                        |
| 35 | 35 | |
| 36 | -    public function __construct($appName, IRequest $request, AttachmentService $attachmentService) { | 
                                                        |
| 37 | - parent::__construct($appName, $request);  | 
                                                        |
| 38 | - $this->attachmentService = $attachmentService;  | 
                                                        |
| 39 | - }  | 
                                                        |
| 36 | +	public function __construct($appName, IRequest $request, AttachmentService $attachmentService) { | 
                                                        |
| 37 | + parent::__construct($appName, $request);  | 
                                                        |
| 38 | + $this->attachmentService = $attachmentService;  | 
                                                        |
| 39 | + }  | 
                                                        |
| 40 | 40 | |
| 41 | - /**  | 
                                                        |
| 41 | + /**  | 
                                                        |
| 42 | 42 | * @NoAdminRequired  | 
                                                        
| 43 | 43 | * @CORS  | 
                                                        
| 44 | 44 | * @NoCSRFRequired  | 
                                                        
| 45 | 45 | *  | 
                                                        
| 46 | 46 | */  | 
                                                        
| 47 | -    public function getAll() { | 
                                                        |
| 48 | -        $attachment = $this->attachmentService->findAll($this->request->getParam('cardId')); | 
                                                        |
| 49 | - return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 50 | - }  | 
                                                        |
| 47 | +	public function getAll() { | 
                                                        |
| 48 | +		$attachment = $this->attachmentService->findAll($this->request->getParam('cardId')); | 
                                                        |
| 49 | + return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 50 | + }  | 
                                                        |
| 51 | 51 | |
| 52 | - /**  | 
                                                        |
| 52 | + /**  | 
                                                        |
| 53 | 53 | * @NoAdminRequired  | 
                                                        
| 54 | 54 | * @CORS  | 
                                                        
| 55 | 55 | * @NoCSRFRequired  | 
                                                        
| 56 | 56 | *  | 
                                                        
| 57 | 57 | */  | 
                                                        
| 58 | -    public function display() { | 
                                                        |
| 59 | -        $attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 58 | +	public function display() { | 
                                                        |
| 59 | +		$attachment = $this->attachmentService->display($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 60 | 60 | return $attachment;  | 
                                                        
| 61 | - }  | 
                                                        |
| 61 | + }  | 
                                                        |
| 62 | 62 | |
| 63 | - /**  | 
                                                        |
| 63 | + /**  | 
                                                        |
| 64 | 64 | * @NoAdminRequired  | 
                                                        
| 65 | 65 | * @CORS  | 
                                                        
| 66 | 66 | * @NoCSRFRequired  | 
                                                        
| 67 | 67 | *  | 
                                                        
| 68 | 68 | */  | 
                                                        
| 69 | -    public function create($type, $data) { | 
                                                        |
| 70 | -        $attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data); | 
                                                        |
| 71 | - return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 72 | - }  | 
                                                        |
| 69 | +	public function create($type, $data) { | 
                                                        |
| 70 | +		$attachment = $this->attachmentService->create($this->request->getParam('cardId'), $type, $data); | 
                                                        |
| 71 | + return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 72 | + }  | 
                                                        |
| 73 | 73 | |
| 74 | - /**  | 
                                                        |
| 74 | + /**  | 
                                                        |
| 75 | 75 | * @NoAdminRequired  | 
                                                        
| 76 | 76 | * @CORS  | 
                                                        
| 77 | 77 | * @NoCSRFRequired  | 
                                                        
| 78 | 78 | *  | 
                                                        
| 79 | 79 | */  | 
                                                        
| 80 | -    public function update($data) { | 
                                                        |
| 81 | -        $attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data); | 
                                                        |
| 82 | - return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 83 | - }  | 
                                                        |
| 80 | +	public function update($data) { | 
                                                        |
| 81 | +		$attachment = $this->attachmentService->update($this->request->getParam('cardId'), $this->request->getParam('attachmentId'), $data); | 
                                                        |
| 82 | + return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 83 | + }  | 
                                                        |
| 84 | 84 | |
| 85 | - /**  | 
                                                        |
| 85 | + /**  | 
                                                        |
| 86 | 86 | * @NoAdminRequired  | 
                                                        
| 87 | 87 | * @CORS  | 
                                                        
| 88 | 88 | * @NoCSRFRequired  | 
                                                        
| 89 | 89 | *  | 
                                                        
| 90 | 90 | */  | 
                                                        
| 91 | -    public function delete() { | 
                                                        |
| 92 | -        $attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 93 | - return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 94 | - }  | 
                                                        |
| 91 | +	public function delete() { | 
                                                        |
| 92 | +		$attachment = $this->attachmentService->delete($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 93 | + return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 94 | + }  | 
                                                        |
| 95 | 95 | |
| 96 | - /**  | 
                                                        |
| 96 | + /**  | 
                                                        |
| 97 | 97 | * @NoAdminRequired  | 
                                                        
| 98 | 98 | * @CORS  | 
                                                        
| 99 | 99 | * @NoCSRFRequired  | 
                                                        
| 100 | 100 | *  | 
                                                        
| 101 | 101 | */  | 
                                                        
| 102 | -    public function restore() { | 
                                                        |
| 103 | -        $attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 104 | - return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 105 | - }  | 
                                                        |
| 102 | +	public function restore() { | 
                                                        |
| 103 | +		$attachment = $this->attachmentService->restore($this->request->getParam('cardId'), $this->request->getParam('attachmentId')); | 
                                                        |
| 104 | + return new DataResponse($attachment, HTTP::STATUS_OK);  | 
                                                        |
| 105 | + }  | 
                                                        |
| 106 | 106 | }  | 
                                                        
| 107 | 107 | \ No newline at end of file  | 
                                                        
@@ -63,7 +63,7 @@  | 
                                                    ||
| 63 | 63 |  	public function index() { | 
                                                        
| 64 | 64 | $params = [  | 
                                                        
| 65 | 65 | 'user' => $this->userId,  | 
                                                        
| 66 | - 'maxUploadSize' => (int)\OCP\Util::uploadLimit(),  | 
                                                        |
| 66 | + 'maxUploadSize' => (int) \OCP\Util::uploadLimit(),  | 
                                                        |
| 67 | 67 | 'canCreate' => $this->permissionService->canCreate()  | 
                                                        
| 68 | 68 | ];  | 
                                                        
| 69 | 69 | |