@@ -71,7 +71,9 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | public function createACLEntry(SharingACL $acl) { |
74 | - if ($acl->getCreated() === null) $acl->setCreated((new \DateTime())->getTimestamp()); |
|
74 | + if ($acl->getCreated() === null) { |
|
75 | + $acl->setCreated((new \DateTime())->getTimestamp()); |
|
76 | + } |
|
75 | 77 | return $this->sharingACL->createACLEntry($acl); |
76 | 78 | } |
77 | 79 | |
@@ -124,12 +126,16 @@ discard block |
||
124 | 126 | $return = []; |
125 | 127 | foreach ($entries as $entry) { |
126 | 128 | // Check if the user can read the credential, probably unnecesary, but just to be sure |
127 | - if (!$entry->hasPermission(SharingACL::READ)) continue; |
|
129 | + if (!$entry->hasPermission(SharingACL::READ)) { |
|
130 | + continue; |
|
131 | + } |
|
128 | 132 | |
129 | 133 | $tmp = $entry->jsonSerialize(); |
130 | 134 | $tmp['credential_data'] = $this->credential->getCredentialById($entry->getItemId())->jsonSerialize(); |
131 | 135 | |
132 | - if (!$entry->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']); |
|
136 | + if (!$entry->hasPermission(SharingACL::FILES)) { |
|
137 | + unset($tmp['credential_data']['files']); |
|
138 | + } |
|
133 | 139 | unset($tmp['credential_data']['shared_key']); |
134 | 140 | $return[] = $tmp; |
135 | 141 | } |
@@ -150,12 +156,16 @@ discard block |
||
150 | 156 | $acl = $this->sharingACL->getItemACL($user_id, $item_guid); |
151 | 157 | |
152 | 158 | // Check if the user can read the credential, probably unnecesary, but just to be sure |
153 | - if (!$acl->hasPermission(SharingACL::READ)) throw new DoesNotExistException("Item not found or wrong access level"); |
|
159 | + if (!$acl->hasPermission(SharingACL::READ)) { |
|
160 | + throw new DoesNotExistException("Item not found or wrong access level"); |
|
161 | + } |
|
154 | 162 | |
155 | 163 | $tmp = $acl->jsonSerialize(); |
156 | 164 | $tmp['credential_data'] = $this->credential->getCredentialById($acl->getItemId())->jsonSerialize(); |
157 | 165 | |
158 | - if (!$acl->hasPermission(SharingACL::FILES)) unset($tmp['credential_data']['files']); |
|
166 | + if (!$acl->hasPermission(SharingACL::FILES)) { |
|
167 | + unset($tmp['credential_data']['files']); |
|
168 | + } |
|
159 | 169 | unset($tmp['credential_data']['shared_key']); |
160 | 170 | |
161 | 171 | return $tmp; |
@@ -170,7 +180,9 @@ discard block |
||
170 | 180 | */ |
171 | 181 | public function getItemHistory($user_id, $item_guid) { |
172 | 182 | $acl = $this->sharingACL->getItemACL($user_id, $item_guid); |
173 | - if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) return []; |
|
183 | + if (!$acl->hasPermission(SharingACL::READ | SharingACL::HISTORY)) { |
|
184 | + return []; |
|
185 | + } |
|
174 | 186 | |
175 | 187 | return $this->revisions->getRevisions($acl->getItemId()); |
176 | 188 | } |
@@ -272,7 +272,9 @@ |
||
272 | 272 | protected function unpad($data) { |
273 | 273 | $length = $this->getKeySize(); |
274 | 274 | $last = ord($data[strlen($data) - 1]); |
275 | - if ($last > $length) return false; |
|
275 | + if ($last > $length) { |
|
276 | + return false; |
|
277 | + } |
|
276 | 278 | if (substr($data, -1 * $last) !== str_repeat(chr($last), $last)) { |
277 | 279 | return false; |
278 | 280 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
86 | - private function fetchAll($sql){ |
|
86 | + private function fetchAll($sql) { |
|
87 | 87 | return $this->db->executeQuery($sql)->fetchAll(); |
88 | 88 | } |
89 | 89 |
@@ -241,7 +241,7 @@ |
||
241 | 241 | $credential['shared_key'] = ''; |
242 | 242 | } |
243 | 243 | |
244 | - if(!isset($credential['shared_key'])){ |
|
244 | + if(!isset($credential['shared_key'])) { |
|
245 | 245 | $credential['shared_key'] = $storedCredential->getSharedKey(); |
246 | 246 | } |
247 | 247 |