@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param DeleteVaultRequest $request |
43 | 43 | * @return \OCP\AppFramework\Db\Entity |
44 | 44 | */ |
45 | - public function createRequest(DeleteVaultRequest $request){ |
|
45 | + public function createRequest(DeleteVaultRequest $request) { |
|
46 | 46 | return $this->insert($request); |
47 | 47 | } |
48 | 48 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * Get all delete requests |
51 | 51 | * @return \OCP\AppFramework\Db\Entity |
52 | 52 | */ |
53 | - public function getDeleteRequests(){ |
|
53 | + public function getDeleteRequests() { |
|
54 | 54 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME; |
55 | 55 | return $this->findEntities($q); |
56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * @param $vault_id integer The vault id |
61 | 61 | * @return \OCP\AppFramework\Db\Entity |
62 | 62 | */ |
63 | - public function getDeleteRequestsForVault($vault_guid){ |
|
63 | + public function getDeleteRequestsForVault($vault_guid) { |
|
64 | 64 | $q = "SELECT * FROM *PREFIX*" . self::TABLE_NAME .' WHERE `vault_guid` = ?'; |
65 | 65 | return $this->findEntity($q, [$vault_guid]); |
66 | 66 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param DeleteVaultRequest $request Request to delete |
71 | 71 | * @return DeleteVaultRequest The deleted request |
72 | 72 | */ |
73 | - public function removeDeleteVaultRequest(DeleteVaultRequest $request){ |
|
73 | + public function removeDeleteVaultRequest(DeleteVaultRequest $request) { |
|
74 | 74 | return $this->delete($request); |
75 | 75 | } |
76 | 76 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | public function expireCredentials() { |
51 | 51 | $expired_credentials = $this->credentialService->getExpiredCredentials($this->utils->getTime()); |
52 | - foreach($expired_credentials as $credential){ |
|
52 | + foreach($expired_credentials as $credential) { |
|
53 | 53 | $link = ''; // @TODO create direct link to credential |
54 | 54 | |
55 | 55 | $sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?'; |
@@ -181,7 +181,7 @@ |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | |
184 | - private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href){ |
|
184 | + private function parseLinkElement($htmlHead, $pageUrlInfo, $base_href) { |
|
185 | 185 | if (preg_match('#<\s*link[^>]*(rel=(["\'])[^>\2]*icon[^>\2]*\2)[^>]*>#i', $htmlHead, $matches)) { |
186 | 186 | $link_tag = $matches[0]; |
187 | 187 | $this->debugInfo['link_tag'] = $link_tag; |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | * @return string |
44 | 44 | */ |
45 | 45 | public static function GUID() { |
46 | - if (function_exists('com_create_guid') === true) |
|
47 | - { |
|
46 | + if (function_exists('com_create_guid') === true) { |
|
48 | 47 | return trim(com_create_guid(), '{}'); |
49 | 48 | } |
50 | 49 | |
@@ -55,16 +54,16 @@ discard block |
||
55 | 54 | * @param $uid |
56 | 55 | * @return string |
57 | 56 | */ |
58 | - public static function getNameByUid($uid){ |
|
57 | + public static function getNameByUid($uid) { |
|
59 | 58 | $um = \OC::$server->getUserManager(); |
60 | 59 | $u = $um->get($uid); |
61 | 60 | return $u->getDisplayName(); |
62 | 61 | } |
63 | 62 | |
64 | - public static function getDirContents($dir, &$results = array()){ |
|
63 | + public static function getDirContents($dir, &$results = array()) { |
|
65 | 64 | $files = scandir($dir); |
66 | 65 | |
67 | - foreach($files as $value){ |
|
66 | + foreach($files as $value) { |
|
68 | 67 | $path = realpath($dir.DIRECTORY_SEPARATOR.$value); |
69 | 68 | if(!is_dir($path)) { |
70 | 69 | $results[] = $path; |
@@ -134,7 +134,7 @@ |
||
134 | 134 | $icon['mimetype'] = mime_content_type($iconPath); |
135 | 135 | $icon['url'] = $this->urlGenerator->linkTo('passman', $path[1]); |
136 | 136 | $icon['pack'] = $pack; |
137 | - if(!isset($icons[$pack])){ |
|
137 | + if(!isset($icons[$pack])) { |
|
138 | 138 | $icons[$pack] = []; |
139 | 139 | } |
140 | 140 | $icons[$pack][] = $icon; |
@@ -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 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | //fetch the proper credentialelement, the returned element from createCredential is not usable in the frontend. |
274 | 274 | $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); |
275 | 275 | foreach ($credentials as &$value) { |
276 | - if($value->getGuid() == $credential->getGuid()){ |
|
276 | + if($value->getGuid() == $credential->getGuid()) { |
|
277 | 277 | return new JSONResponse($value); |
278 | 278 | } |
279 | 279 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $this->sharingService->unshareCredential($credential->getGuid()); |
315 | 315 | foreach ($this->credentialRevisionService->getRevisions($credential->getId()) as $revision) { |
316 | 316 | $id = $revision['revision_id']; |
317 | - if(isset($id)){ |
|
317 | + if(isset($id)) { |
|
318 | 318 | $this->credentialRevisionService->deleteRevision($id, $this->userId); |
319 | 319 | } |
320 | 320 | } |