@@ -107,15 +107,15 @@ |
||
107 | 107 | |
108 | 108 | |
109 | 109 | //fetch the proper credentialelement, the returned element from createCredential is not usable in the frontend. |
110 | - $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); |
|
111 | - foreach ($credentials as &$value) { |
|
112 | - if($value->getGuid() == $credential->getGuid()){ |
|
113 | - return new JSONResponse($value); |
|
114 | - } |
|
115 | - } |
|
116 | - |
|
117 | - //return old value as fallback |
|
118 | - return new JSONResponse($credentials); |
|
110 | + $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); |
|
111 | + foreach ($credentials as &$value) { |
|
112 | + if($value->getGuid() == $credential->getGuid()){ |
|
113 | + return new JSONResponse($value); |
|
114 | + } |
|
115 | + } |
|
116 | + |
|
117 | + //return old value as fallback |
|
118 | + return new JSONResponse($credentials); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | //fetch the proper credentialelement, the returned element from createCredential is not usable in the frontend. |
110 | 110 | $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); |
111 | 111 | foreach ($credentials as &$value) { |
112 | - if($value->getGuid() == $credential->getGuid()){ |
|
112 | + if ($value->getGuid() == $credential->getGuid()) { |
|
113 | 113 | return new JSONResponse($value); |
114 | 114 | } |
115 | 115 | } |
@@ -185,13 +185,13 @@ discard block |
||
185 | 185 | $activity . '_self', array($label, $this->userId, $revision_created), |
186 | 186 | '', array(), |
187 | 187 | $link, $this->userId, Activity::TYPE_ITEM_ACTION); |
188 | - } else if (($storedCredential->getDeleteTime() === 0) && (int)$delete_time > 0) { |
|
188 | + } else if (($storedCredential->getDeleteTime() === 0) && (int) $delete_time > 0) { |
|
189 | 189 | $activity = 'item_deleted'; |
190 | 190 | $this->activityService->add( |
191 | 191 | $activity . '_self', array($label, $this->userId), |
192 | 192 | '', array(), |
193 | 193 | $link, $this->userId, Activity::TYPE_ITEM_ACTION); |
194 | - } else if (($storedCredential->getDeleteTime() > 0) && (int)$delete_time === 0) { |
|
194 | + } else if (($storedCredential->getDeleteTime() > 0) && (int) $delete_time === 0) { |
|
195 | 195 | $activity = 'item_recovered'; |
196 | 196 | $this->activityService->add( |
197 | 197 | $activity . '_self', array($label, $this->userId), |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->sharingService->unshareCredential($credential->getGuid()); |
305 | 305 | foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) { |
306 | 306 | $id = $revision['revision_id']; |
307 | - if(isset($id)){ |
|
307 | + if (isset($id)) { |
|
308 | 308 | $this->credentialRevisionService->deleteRevision($id, $this->userId); |
309 | 309 | } |
310 | 310 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | //fetch the proper credentialelement, the returned element from createCredential is not usable in the frontend. |
110 | 110 | $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); |
111 | 111 | foreach ($credentials as &$value) { |
112 | - if($value->getGuid() == $credential->getGuid()){ |
|
112 | + if($value->getGuid() == $credential->getGuid()) { |
|
113 | 113 | return new JSONResponse($value); |
114 | 114 | } |
115 | 115 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->sharingService->unshareCredential($credential->getGuid()); |
305 | 305 | foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) { |
306 | 306 | $id = $revision['revision_id']; |
307 | - if(isset($id)){ |
|
307 | + if(isset($id)) { |
|
308 | 308 | $this->credentialRevisionService->deleteRevision($id, $this->userId); |
309 | 309 | } |
310 | 310 | } |