Completed
Push — master ( da2c83...bbbcc3 )
by Sander
17:29 queued 07:34
created
lib/AppInfo/Application.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
 		parent::__construct('passman');
52 52
 		$container = $this->getContainer();
53 53
 		// Allow automatic DI for the View, until we migrated to Nodes API
54
-		$container->registerService(View::class, function () {
54
+		$container->registerService(View::class, function() {
55 55
 			return new View('');
56 56
 		}, false);
57
-		$container->registerService('isCLI', function () {
57
+		$container->registerService('isCLI', function() {
58 58
 			return \OC::$CLI;
59 59
 		});
60 60
 
61 61
 		/**
62 62
 		 * Middleware
63 63
 		 */
64
-		$container->registerService('ShareMiddleware', function ($c) {
64
+		$container->registerService('ShareMiddleware', function($c) {
65 65
 			return new ShareMiddleware($c->query('SettingsService'));
66 66
 		});
67 67
 		$container->registerMiddleware('ShareMiddleware');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		/**
70 70
 		 * Controllers
71 71
 		 */
72
-		$container->registerService('ShareController', function ($c) {
72
+		$container->registerService('ShareController', function($c) {
73 73
 			$container = $this->getContainer();
74 74
 			$server = $container->getServer();
75 75
 			return new ShareController(
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 
92 92
 		/** Cron **/
93
-		$container->registerService('CronService', function ($c) {
93
+		$container->registerService('CronService', function($c) {
94 94
 			return new CronService(
95 95
 				$c->query('CredentialService'),
96 96
 				$c->query('Logger'),
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
 			);
102 102
 		});
103 103
 
104
-		$container->registerService('Db', function () {
104
+		$container->registerService('Db', function() {
105 105
 			return new Db();
106 106
 		});
107 107
 
108
-		$container->registerService('Logger', function ($c) {
108
+		$container->registerService('Logger', function($c) {
109 109
 			return $c->query('ServerContainer')->getLogger();
110 110
 		});
111 111
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$c = $this->getContainer();
134 134
 		/** @var \OCP\IServerContainer $server */
135 135
 		$server = $c->getServer();
136
-		$navigationEntry = function () use ($c, $server) {
136
+		$navigationEntry = function() use ($c, $server) {
137 137
 			return [
138 138
 				'id' => $c->getAppName(),
139 139
 				'order' => 10,
Please login to merge, or discard this patch.
migration/serversideencryption.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
middleware/sharemiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 			$setting = (in_array($methodName, $publicMethods)) ? 'link_sharing_enabled' : 'user_sharing_enabled';
27 27
 			$sharing_enabled = ($this->settings->isEnabled($setting));
28 28
 
29
-			if(in_array($methodName, $user_pub_methods)){
29
+			if (in_array($methodName, $user_pub_methods)) {
30 30
 				$sharing_enabled = ($this->settings->isEnabled('link_sharing_enabled') || $this->settings->isEnabled('user_sharing_enabled'));
31 31
 			}
32 32
 
Please login to merge, or discard this patch.
lib/Db/SharingACLMapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
         parent::__construct($db, 'passman_sharing_acl');
37 37
     }
38 38
 
39
-    public function createACLEntry(SharingACL $acl){
39
+    public function createACLEntry(SharingACL $acl) {
40 40
         return $this->insert($acl);
41 41
     }
42 42
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      * @return SharingACL[]
48 48
      */
49 49
     public function getVaultEntries($user_id, $vault_guid) {
50
-        $q = "SELECT * FROM ". self::TABLE_NAME ." WHERE user_id = ? AND vault_guid = ?";
50
+        $q = "SELECT * FROM " . self::TABLE_NAME . " WHERE user_id = ? AND vault_guid = ?";
51 51
         return $this->findEntities($q, [$user_id, $vault_guid]);
52 52
     }
53 53
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $q = "SELECT * FROM " . self::TABLE_NAME . " WHERE item_guid = ? AND ";
62 62
         $filter = [$item_guid];
63 63
         $q .= ($user_id === null) ? 'user_id is null' : 'user_id = ? ';
64
-        if ($user_id !== null){
64
+        if ($user_id !== null) {
65 65
 			$filter[] = $user_id;
66 66
         }
67 67
 
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
      * @return SharingACL[]
86 86
      */
87 87
     public function getCredentialAclList($item_guid) {
88
-        $q = "SELECT * FROM ". self::TABLE_NAME ." WHERE item_guid = ?";
88
+        $q = "SELECT * FROM " . self::TABLE_NAME . " WHERE item_guid = ?";
89 89
         return $this->findEntities($q, [$item_guid]);
90 90
     }
91 91
 
92
-    public function deleteShareACL(SharingACL $ACL){
92
+    public function deleteShareACL(SharingACL $ACL) {
93 93
     	return $this->delete($ACL);
94 94
 	}
95 95
 }
96 96
\ No newline at end of file
Please login to merge, or discard this patch.
controller/vaultcontroller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 			foreach ($vaults as $vault) {
60 60
 				$credential = $this->credentialService->getRandomCredentialByVaultId($vault->getId(), $this->userId);
61 61
 				$secret_field = $protected_credential_fields[array_rand($protected_credential_fields)];
62
-				if(isset($credential)) {
62
+				if (isset($credential)) {
63 63
 					array_push($result, array(
64 64
 						'vault_id' => $vault->getId(),
65 65
 						'guid' => $vault->getGuid(),
Please login to merge, or discard this patch.
lib/Db/VaultMapper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result
63 63
 	 * @return Vault[]
64 64
 	 */
65
-	public function findVaultsFromUser($userId){
65
+	public function findVaultsFromUser($userId) {
66 66
 		$sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' .
67 67
 			'WHERE `user_id` = ? ';
68 68
 		$params = [$userId];
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * @param $userId
76 76
 	 * @return Vault
77 77
 	 */
78
-	public function create($vault_name, $userId){
78
+	public function create($vault_name, $userId) {
79 79
 		$vault = new Vault();
80 80
 		$vault->setName($vault_name);
81 81
 		$vault->setUserId($userId);
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 * @param $vault_id
91 91
 	 * @param $user_id
92 92
 	 */
93
-	public function setLastAccess($vault_id, $user_id){
93
+	public function setLastAccess($vault_id, $user_id) {
94 94
 		$vault = new Vault();
95 95
 		$vault->setId($vault_id);
96 96
 		$vault->setUserId($user_id);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * Update vault
103 103
 	 * @param Vault $vault
104 104
 	 */
105
-	public function updateVault(Vault $vault){
105
+	public function updateVault(Vault $vault) {
106 106
 		$this->update($vault);
107 107
 	}
108 108
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	 * @param $privateKey
113 113
 	 * @param $publicKey
114 114
 	 */
115
-	public function updateSharingKeys($vault_id, $privateKey, $publicKey){
115
+	public function updateSharingKeys($vault_id, $privateKey, $publicKey) {
116 116
 		$vault = new Vault();
117 117
 		$vault->setId($vault_id);
118 118
 		$vault->setPrivateSharingKey($privateKey);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 	 * Delete a vault
126 126
 	 * @param Vault $vault
127 127
 	 */
128
-	public function deleteVault(Vault $vault){
128
+	public function deleteVault(Vault $vault) {
129 129
 		$this->delete($vault);
130 130
 	}
131 131
 }
132 132
\ No newline at end of file
Please login to merge, or discard this patch.
lib/Service/VaultService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	 * @param $vault_id
93 93
 	 * @param $user_id
94 94
 	 */
95
-	public function setLastAccess($vault_id, $user_id){
95
+	public function setLastAccess($vault_id, $user_id) {
96 96
 		return $this->vaultMapper->setLastAccess($vault_id, $user_id);
97 97
 	}
98 98
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 * @param $privateKey
103 103
 	 * @param $publicKey
104 104
 	 */
105
-	public function updateSharingKeys($vault_id, $privateKey, $publicKey){
105
+	public function updateSharingKeys($vault_id, $privateKey, $publicKey) {
106 106
 		return $this->vaultMapper->updateSharingKeys($vault_id, $privateKey, $publicKey);
107 107
 	}
108 108
 
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 	 * @param string $vault_guid
112 112
 	 * @param string $user_id
113 113
 	 */
114
-	public function deleteVault($vault_guid, $user_id){
114
+	public function deleteVault($vault_guid, $user_id) {
115 115
 		$vault = $this->getByGuid($vault_guid, $user_id);
116
-		if($vault instanceof Vault) {
116
+		if ($vault instanceof Vault) {
117 117
 			$this->vaultMapper->deleteVault($vault);
118 118
 		}
119 119
 	}
Please login to merge, or discard this patch.
middleware/apimiddleware.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	public function afterController($controller, $methodName, Response $response) {
19
-		if($response instanceof JSONResponse){
20
-			if(isset($this->request->server['HTTP_ORIGIN'])) {
19
+		if ($response instanceof JSONResponse) {
20
+			if (isset($this->request->server['HTTP_ORIGIN'])) {
21 21
 				$response->addHeader('Access-Control-Allow-Origin', $this->request->server['HTTP_ORIGIN']);
22 22
 			}
23 23
 		}
Please login to merge, or discard this patch.
controller/filecontroller.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	public function __construct($AppName,
24 24
 								IRequest $request,
25 25
 								$UserId,
26
-								FileService $fileService){
26
+								FileService $fileService) {
27 27
 		parent::__construct(
28 28
 			$AppName,
29 29
 			$request,
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		return new JSONResponse($this->fileService->deleteFile($file_id, $this->userId));
66 66
 	}
67 67
 
68
-	public function updateFile($file_id, $file_data, $filename){
69
-		try{
68
+	public function updateFile($file_id, $file_data, $filename) {
69
+		try {
70 70
 			$file = $this->fileService->getFile($file_id, $this->userId);
71
-		} catch (\Exception $doesNotExistException){
71
+		} catch (\Exception $doesNotExistException) {
72 72
 
73 73
 		}
74
-		if($file){
75
-			if($file_data) {
74
+		if ($file) {
75
+			if ($file_data) {
76 76
 				$file->setFileData($file_data);
77 77
 			}
78
-			if($filename) {
78
+			if ($filename) {
79 79
 				$file->setFilename($filename);
80 80
 			}
81
-			if($filename || $file_data){
81
+			if ($filename || $file_data) {
82 82
 				new JSONResponse($this->fileService->updateFile($file));
83 83
 			}
84 84
 		}
Please login to merge, or discard this patch.