@@ -30,8 +30,6 @@ |
||
| 30 | 30 | use OCA\Deck\Db\Stack; |
| 31 | 31 | use OCA\Deck\Db\StackMapper; |
| 32 | 32 | use OCA\Deck\StatusException; |
| 33 | -use OCP\ICache; |
|
| 34 | -use OCP\ICacheFactory; |
|
| 35 | 33 | |
| 36 | 34 | |
| 37 | 35 | class StackService { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $qb = $this->db->getQueryBuilder(); |
| 54 | 54 | $qb->select('*') |
| 55 | 55 | ->from('deck_attachment') |
| 56 | - ->where($qb->expr()->eq('id', (string)$id)); |
|
| 56 | + ->where($qb->expr()->eq('id', (string) $id)); |
|
| 57 | 57 | |
| 58 | 58 | $cursor = $qb->execute(); |
| 59 | 59 | $row = $cursor->fetch(PDO::FETCH_ASSOC); |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | $qb = $this->db->getQueryBuilder(); |
| 72 | 72 | $qb->select('*') |
| 73 | 73 | ->from('deck_attachment') |
| 74 | - ->where($qb->expr()->eq('card_id', (string)$cardId, IQueryBuilder::PARAM_INT)) |
|
| 75 | - ->andWhere($qb->expr()->eq('deleted_at', (string)0, IQueryBuilder::PARAM_INT)); |
|
| 74 | + ->where($qb->expr()->eq('card_id', (string) $cardId, IQueryBuilder::PARAM_INT)) |
|
| 75 | + ->andWhere($qb->expr()->eq('deleted_at', (string) 0, IQueryBuilder::PARAM_INT)); |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | $entities = []; |
| 79 | 79 | $cursor = $qb->execute(); |
| 80 | - while($row = $cursor->fetch()){ |
|
| 80 | + while ($row = $cursor->fetch()) { |
|
| 81 | 81 | $entities[] = $this->mapRowToEntity($row); |
| 82 | 82 | } |
| 83 | 83 | $cursor->closeCursor(); |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | ->where($qb->expr()->gt('deleted_at', '0', IQueryBuilder::PARAM_INT)); |
| 94 | 94 | if ($withOffset) { |
| 95 | 95 | $qb |
| 96 | - ->andWhere($qb->expr()->lt('deleted_at', (string)$timeLimit, IQueryBuilder::PARAM_INT)); |
|
| 96 | + ->andWhere($qb->expr()->lt('deleted_at', (string) $timeLimit, IQueryBuilder::PARAM_INT)); |
|
| 97 | 97 | } |
| 98 | 98 | if ($cardId !== null) { |
| 99 | 99 | $qb |
| 100 | - ->andWhere($qb->expr()->eq('card_id', (string)$cardId, IQueryBuilder::PARAM_INT)); |
|
| 100 | + ->andWhere($qb->expr()->eq('card_id', (string) $cardId, IQueryBuilder::PARAM_INT)); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $entities = []; |
| 104 | 104 | $cursor = $qb->execute(); |
| 105 | - while($row = $cursor->fetch()){ |
|
| 105 | + while ($row = $cursor->fetch()) { |
|
| 106 | 106 | $entities[] = $this->mapRowToEntity($row); |
| 107 | 107 | } |
| 108 | 108 | $cursor->closeCursor(); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @throws NotPermittedException |
| 69 | 69 | */ |
| 70 | 70 | private function getFolder(Attachment $attachment) { |
| 71 | - $folderName = 'file-card-' . (int)$attachment->getCardId(); |
|
| 71 | + $folderName = 'file-card-' . (int) $attachment->getCardId(); |
|
| 72 | 72 | try { |
| 73 | 73 | $folder = $this->appData->getFolder($folderName); |
| 74 | 74 | } catch (NotFoundException $e) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return $attachment; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - private function getUploadedFile () { |
|
| 97 | + private function getUploadedFile() { |
|
| 98 | 98 | $file = $this->request->getUploadedFile('file'); |
| 99 | 99 | $error = null; |
| 100 | 100 | $phpFileUploadErrors = [ |
@@ -24,10 +24,8 @@ |
||
| 24 | 24 | namespace OCA\Deck\Service; |
| 25 | 25 | |
| 26 | 26 | |
| 27 | -use OC\Security\CSP\ContentSecurityPolicyManager; |
|
| 28 | 27 | use OCA\Deck\Db\Attachment; |
| 29 | 28 | use OCP\AppFramework\Http\ContentSecurityPolicy; |
| 30 | -use OCP\AppFramework\Http\EmptyContentSecurityPolicy; |
|
| 31 | 29 | use OCP\AppFramework\Http\FileDisplayResponse; |
| 32 | 30 | use OCP\Files\IAppData; |
| 33 | 31 | use OCP\Files\NotFoundException; |