@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | public function getDuedate($isoFormat = false) { |
67 | - if($this->duedate === null) { |
|
67 | + if ($this->duedate === null) { |
|
68 | 68 | return null; |
69 | 69 | } |
70 | 70 | $dt = new DateTime($this->duedate); |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | $due = strtotime($this->duedate); |
81 | 81 | |
82 | 82 | $today = new DateTime(); |
83 | - $today->setTime( 0, 0); |
|
83 | + $today->setTime(0, 0); |
|
84 | 84 | |
85 | 85 | $match_date = new DateTime($this->duedate); |
86 | 86 | |
87 | - $match_date->setTime( 0, 0); |
|
87 | + $match_date->setTime(0, 0); |
|
88 | 88 | |
89 | - $diff = $today->diff( $match_date ); |
|
90 | - $diffDays = (integer)$diff->format('%R%a'); // Extract days count in interval |
|
89 | + $diff = $today->diff($match_date); |
|
90 | + $diffDays = (integer) $diff->format('%R%a'); // Extract days count in interval |
|
91 | 91 | |
92 | - if($due !== false) { |
|
92 | + if ($due !== false) { |
|
93 | 93 | if ($diffDays === 1) { |
94 | 94 | $json['overdue'] = self::DUEDATE_NEXT; |
95 | 95 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $notification = $this->notificationManager->createNotification(); |
84 | 84 | $notification |
85 | 85 | ->setApp('deck') |
86 | - ->setUser((string)$user->getUID()) |
|
86 | + ->setUser((string) $user->getUID()) |
|
87 | 87 | ->setObject('card', $card->getId()) |
88 | 88 | ->setSubject('card-overdue', [ |
89 | 89 | $card->getTitle(), $board->getTitle() |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $notification = $this->notificationManager->createNotification(); |
133 | 133 | $notification |
134 | 134 | ->setApp('deck') |
135 | - ->setUser((string)$userId) |
|
135 | + ->setUser((string) $userId) |
|
136 | 136 | ->setDateTime(new DateTime()) |
137 | 137 | ->setObject('board', $board->getId()) |
138 | 138 | ->setSubject('board-shared', [$board->getTitle(), $this->currentUser]); |
@@ -178,7 +178,7 @@ |
||
178 | 178 | $userManager = $this->userManager; |
179 | 179 | $card->resolveRelation('owner', function($owner) use (&$userManager) { |
180 | 180 | $user = $userManager->get($owner); |
181 | - if($user !== null) { |
|
181 | + if ($user !== null) { |
|
182 | 182 | return new User($user); |
183 | 183 | } |
184 | 184 | return null; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | public function findToDelete() { |
142 | 142 | // add buffer of 5 min |
143 | - $timeLimit = time()-(60*5); |
|
143 | + $timeLimit = time() - (60 * 5); |
|
144 | 144 | $sql = 'SELECT id, title, owner, color, archived, deleted_at FROM `*PREFIX*deck_boards` ' . |
145 | 145 | 'WHERE `deleted_at` > 0 AND `deleted_at` < ?'; |
146 | 146 | return $this->findEntities($sql, [$timeLimit]); |
@@ -181,17 +181,17 @@ discard block |
||
181 | 181 | $userManager = $this->userManager; |
182 | 182 | $groupManager = $this->groupManager; |
183 | 183 | $acl->resolveRelation('participant', function($participant) use (&$acl, &$userManager, &$groupManager) { |
184 | - if($acl->getType() === Acl::PERMISSION_TYPE_USER) { |
|
184 | + if ($acl->getType() === Acl::PERMISSION_TYPE_USER) { |
|
185 | 185 | $user = $userManager->get($participant); |
186 | - if($user !== null) { |
|
186 | + if ($user !== null) { |
|
187 | 187 | return new User($user); |
188 | 188 | } |
189 | 189 | \OC::$server->getLogger()->debug('User ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant()); |
190 | 190 | return null; |
191 | 191 | } |
192 | - if($acl->getType() === Acl::PERMISSION_TYPE_GROUP) { |
|
192 | + if ($acl->getType() === Acl::PERMISSION_TYPE_GROUP) { |
|
193 | 193 | $group = $groupManager->get($participant); |
194 | - if($group !== null) { |
|
194 | + if ($group !== null) { |
|
195 | 195 | return new Group($group); |
196 | 196 | } |
197 | 197 | \OC::$server->getLogger()->debug('Group ' . $acl->getId() . ' not found when mapping acl ' . $acl->getParticipant()); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $userManager = $this->userManager; |
209 | 209 | $board->resolveRelation('owner', function($owner) use (&$userManager) { |
210 | 210 | $user = $userManager->get($owner); |
211 | - if($user !== null) { |
|
211 | + if ($user !== null) { |
|
212 | 212 | return new User($user); |
213 | 213 | } |
214 | 214 | return null; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $userManager = $this->userManager; |
81 | 81 | $assignment->resolveRelation('participant', function() use (&$userManager, &$assignment) { |
82 | 82 | $user = $userManager->get($assignment->getParticipant()); |
83 | - if($user !== null) { |
|
83 | + if ($user !== null) { |
|
84 | 84 | return new User($user); |
85 | 85 | } |
86 | 86 | return null; |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | $groupBoards = $this->boardMapper->findAllByGroups($userInfo['user'], $userInfo['groups']); |
70 | 70 | $complete = array_merge($userBoards, $groupBoards); |
71 | 71 | $result = []; |
72 | - foreach($complete as &$item) { |
|
73 | - if(!array_key_exists($item->getId(), $result)) { |
|
72 | + foreach ($complete as &$item) { |
|
73 | + if (!array_key_exists($item->getId(), $result)) { |
|
74 | 74 | $this->boardMapper->mapOwner($item); |
75 | - if($item->getAcl() !== null) { |
|
75 | + if ($item->getAcl() !== null) { |
|
76 | 76 | foreach ($item->getAcl() as &$acl) { |
77 | 77 | $this->boardMapper->mapAcl($acl); |
78 | 78 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $board = $this->boardMapper->find($boardId, true, true); |
97 | 97 | $this->boardMapper->mapOwner($board); |
98 | 98 | foreach ($board->getAcl() as &$acl) { |
99 | - if($acl !== null) { |
|
99 | + if ($acl !== null) { |
|
100 | 100 | $this->boardMapper->mapAcl($acl); |
101 | 101 | } |
102 | 102 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $this->boardMapper->mapAcl($acl); |
250 | 250 | if ($acl->getType() === Acl::PERMISSION_TYPE_USER) { |
251 | 251 | $assignements = $this->assignedUsersMapper->findByUserId($acl->getParticipant()); |
252 | - foreach($assignements as $assignement) { |
|
252 | + foreach ($assignements as $assignement) { |
|
253 | 253 | $this->assignedUsersMapper->delete($assignement); |
254 | 254 | } |
255 | 255 | } |