Completed
Pull Request — master (#3643)
by Christoph
12:28
created
apps/federation/lib/BackgroundJob/GetSharedSecret.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
  *
46 46
  * @package OCA\Federation\Backgroundjob
47 47
  */
48
-class GetSharedSecret extends Job{
48
+class GetSharedSecret extends Job {
49 49
 
50 50
 	/** @var IClient */
51 51
 	private $httpClient;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 		$result = null;
146 146
 		try {
147 147
 			$result = $this->httpClient->get(
148
-				$target . $this->endPoint,
148
+				$target.$this->endPoint,
149 149
 				[
150 150
 					'query' =>
151 151
 						[
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 		} catch (ClientException $e) {
163 163
 			$status = $e->getCode();
164 164
 			if ($status === Http::STATUS_FORBIDDEN) {
165
-				$this->logger->info($target . ' refused to exchange a shared secret with you.', ['app' => 'federation']);
165
+				$this->logger->info($target.' refused to exchange a shared secret with you.', ['app' => 'federation']);
166 166
 			} else {
167 167
 				$this->logger->logException($e, ['app' => 'federation']);
168 168
 			}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			&& $status !== Http::STATUS_FORBIDDEN
178 178
 		) {
179 179
 			$this->retainJob = true;
180
-		}  else {
180
+		} else {
181 181
 			// reset token if we received a valid response
182 182
 			$this->dbHandler->addToken($target, '');
183 183
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 				);
193 193
 			} else {
194 194
 				$this->logger->error(
195
-						'remote server "' . $target . '"" does not return a valid shared secret',
195
+						'remote server "'.$target.'"" does not return a valid shared secret',
196 196
 						['app' => 'federation']
197 197
 				);
198 198
 				$this->trustedServers->setServerStatus($target, TrustedServers::STATUS_FAILURE);
Please login to merge, or discard this patch.
apps/federation/lib/BackgroundJob/RequestSharedSecret.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
 		try {
146 146
 			$result = $this->httpClient->post(
147
-				$target . $this->endPoint,
147
+				$target.$this->endPoint,
148 148
 				[
149 149
 					'body' => [
150 150
 						'url' => $source,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 		} catch (ClientException $e) {
161 161
 			$status = $e->getCode();
162 162
 			if ($status === Http::STATUS_FORBIDDEN) {
163
-				$this->logger->info($target . ' refused to ask for a shared secret.', ['app' => 'federation']);
163
+				$this->logger->info($target.' refused to ask for a shared secret.', ['app' => 'federation']);
164 164
 			} else {
165 165
 				$this->logger->logException($e, ['app' => 'federation']);
166 166
 			}
Please login to merge, or discard this patch.
apps/federation/lib/DbHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 		$result = $query->execute();
88 88
 
89 89
 		if ($result) {
90
-			return (int)$this->connection->lastInsertId('*PREFIX*'.$this->dbTable);
90
+			return (int) $this->connection->lastInsertId('*PREFIX*'.$this->dbTable);
91 91
 		} else {
92
-			$message = 'Internal failure, Could not add trusted server: ' . $url;
92
+			$message = 'Internal failure, Could not add trusted server: '.$url;
93 93
 			$message_t = $this->IL10N->t('Could not add server');
94 94
 			throw new HintException($message, $message_t);
95 95
 		}
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		$result = $query->execute()->fetchAll();
125 125
 
126 126
 		if (empty($result)) {
127
-			throw new \Exception('No Server found with ID: ' . $id);
127
+			throw new \Exception('No Server found with ID: '.$id);
128 128
 		}
129 129
 
130 130
 		return $result[0];
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$result = $query->execute()->fetch();
194 194
 
195 195
 		if (!isset($result['token'])) {
196
-			throw new \Exception('No token found for: ' . $url);
196
+			throw new \Exception('No token found for: '.$url);
197 197
 		}
198 198
 
199 199
 		return $result['token'];
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 				->setParameter('url_hash', $hash);
267 267
 
268 268
 		$result = $query->execute()->fetch();
269
-		return (int)$result['status'];
269
+		return (int) $result['status'];
270 270
 	}
271 271
 
272 272
 	/**
Please login to merge, or discard this patch.
apps/federation/lib/SyncJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 		$ss = $app->getSyncService();
38 38
 		$ss->syncThemAll(function($url, $ex) {
39 39
 			if ($ex instanceof \Exception) {
40
-				\OC::$server->getLogger()->error("Error while syncing $url : " . $ex->getMessage(), ['app' => 'fed-sync']);
40
+				\OC::$server->getLogger()->error("Error while syncing $url : ".$ex->getMessage(), ['app' => 'fed-sync']);
41 41
 			}
42 42
 		});
43 43
 	}
Please login to merge, or discard this patch.
apps/dav/lib/DAV/PublicAuth.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
 	 */
85 85
 	private function isRequestPublic(RequestInterface $request) {
86 86
 		$url = $request->getPath();
87
-		$matchingUrls = array_filter($this->publicURLs, function ($publicUrl) use ($url) {
87
+		$matchingUrls = array_filter($this->publicURLs, function($publicUrl) use ($url) {
88 88
 			return strpos($url, $publicUrl, 0) === 0;
89 89
 		});
90 90
 		return !empty($matchingUrls);
Please login to merge, or discard this patch.
apps/dav/lib/DAV/GroupPrincipalBackend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 		$principals = [];
60 60
 
61 61
 		if ($prefixPath === self::PRINCIPAL_PREFIX) {
62
-			foreach($this->groupManager->search('') as $user) {
62
+			foreach ($this->groupManager->search('') as $user) {
63 63
 				$principals[] = $this->groupToPrincipal($user);
64 64
 			}
65 65
 		}
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	 */
193 193
 	protected function userToPrincipal($user) {
194 194
 		$principal = [
195
-			'uri' => 'principals/users/' . $user->getUID(),
195
+			'uri' => 'principals/users/'.$user->getUID(),
196 196
 			'{DAV:}displayname' => $user->getDisplayName(),
197 197
 		];
198 198
 
Please login to merge, or discard this patch.
apps/dav/lib/DAV/Sharing/Xml/ShareRequest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
     static function xmlDeserialize(Reader $reader) {
48 48
 
49 49
         $elements = $reader->parseInnerTree([
50
-            '{' . Plugin::NS_OWNCLOUD. '}set'    => 'Sabre\\Xml\\Element\\KeyValue',
51
-            '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue',
50
+            '{'.Plugin::NS_OWNCLOUD.'}set'    => 'Sabre\\Xml\\Element\\KeyValue',
51
+            '{'.Plugin::NS_OWNCLOUD.'}remove' => 'Sabre\\Xml\\Element\\KeyValue',
52 52
         ]);
53 53
 
54 54
         $set = [];
@@ -57,21 +57,21 @@  discard block
 block discarded – undo
57 57
         foreach ($elements as $elem) {
58 58
             switch ($elem['name']) {
59 59
 
60
-                case '{' . Plugin::NS_OWNCLOUD . '}set' :
60
+                case '{'.Plugin::NS_OWNCLOUD.'}set' :
61 61
                     $sharee = $elem['value'];
62 62
 
63
-                    $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary';
64
-                    $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name';
63
+                    $sumElem = '{'.Plugin::NS_OWNCLOUD.'}summary';
64
+                    $commonName = '{'.Plugin::NS_OWNCLOUD.'}common-name';
65 65
 
66 66
                     $set[] = [
67 67
                         'href'       => $sharee['{DAV:}href'],
68 68
                         'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null,
69 69
                         'summary'    => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null,
70
-                        'readOnly'   => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee),
70
+                        'readOnly'   => !array_key_exists('{'.Plugin::NS_OWNCLOUD.'}read-write', $sharee),
71 71
                     ];
72 72
                     break;
73 73
 
74
-                case '{' . Plugin::NS_OWNCLOUD . '}remove' :
74
+                case '{'.Plugin::NS_OWNCLOUD.'}remove' :
75 75
                     $remove[] = $elem['value']['{DAV:}href'];
76 76
                     break;
77 77
 
Please login to merge, or discard this patch.
apps/dav/lib/DAV/Sharing/Xml/Invite.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	function xmlSerialize(Writer $writer) {
123 123
 
124
-		$cs = '{' . Plugin::NS_OWNCLOUD . '}';
124
+		$cs = '{'.Plugin::NS_OWNCLOUD.'}';
125 125
 
126 126
 		if (!is_null($this->organizer)) {
127 127
 
128
-			$writer->startElement($cs . 'organizer');
128
+			$writer->startElement($cs.'organizer');
129 129
 			$writer->writeElement('{DAV:}href', $this->organizer['href']);
130 130
 
131 131
 			if (isset($this->organizer['commonName']) && $this->organizer['commonName']) {
132
-				$writer->writeElement($cs . 'common-name', $this->organizer['commonName']);
132
+				$writer->writeElement($cs.'common-name', $this->organizer['commonName']);
133 133
 			}
134 134
 			if (isset($this->organizer['firstName']) && $this->organizer['firstName']) {
135
-				$writer->writeElement($cs . 'first-name', $this->organizer['firstName']);
135
+				$writer->writeElement($cs.'first-name', $this->organizer['firstName']);
136 136
 			}
137 137
 			if (isset($this->organizer['lastName']) && $this->organizer['lastName']) {
138
-				$writer->writeElement($cs . 'last-name', $this->organizer['lastName']);
138
+				$writer->writeElement($cs.'last-name', $this->organizer['lastName']);
139 139
 			}
140 140
 			$writer->endElement(); // organizer
141 141
 
@@ -143,23 +143,23 @@  discard block
 block discarded – undo
143 143
 
144 144
 		foreach ($this->users as $user) {
145 145
 
146
-			$writer->startElement($cs . 'user');
146
+			$writer->startElement($cs.'user');
147 147
 			$writer->writeElement('{DAV:}href', $user['href']);
148 148
 			if (isset($user['commonName']) && $user['commonName']) {
149
-				$writer->writeElement($cs . 'common-name', $user['commonName']);
149
+				$writer->writeElement($cs.'common-name', $user['commonName']);
150 150
 			}
151
-			$writer->writeElement($cs . 'invite-accepted');
151
+			$writer->writeElement($cs.'invite-accepted');
152 152
 
153
-			$writer->startElement($cs . 'access');
153
+			$writer->startElement($cs.'access');
154 154
 			if ($user['readOnly']) {
155
-				$writer->writeElement($cs . 'read');
155
+				$writer->writeElement($cs.'read');
156 156
 			} else {
157
-				$writer->writeElement($cs . 'read-write');
157
+				$writer->writeElement($cs.'read-write');
158 158
 			}
159 159
 			$writer->endElement(); // access
160 160
 
161 161
 			if (isset($user['summary']) && $user['summary']) {
162
-				$writer->writeElement($cs . 'summary', $user['summary']);
162
+				$writer->writeElement($cs.'summary', $user['summary']);
163 163
 			}
164 164
 
165 165
 			$writer->endElement(); //user
Please login to merge, or discard this patch.
apps/dav/lib/DAV/Sharing/Plugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
 	 */
100 100
 	function initialize(Server $server) {
101 101
 		$this->server = $server;
102
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}share'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest';
103
-		$this->server->xml->elementMap['{' . Plugin::NS_OWNCLOUD . '}invite'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite';
102
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}share'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\ShareRequest';
103
+		$this->server->xml->elementMap['{'.Plugin::NS_OWNCLOUD.'}invite'] = 'OCA\\DAV\\DAV\\Sharing\\Xml\\Invite';
104 104
 
105 105
 		$this->server->on('method:POST', [$this, 'httpPost']);
106
-		$this->server->on('propFind',    [$this, 'propFind']);
106
+		$this->server->on('propFind', [$this, 'propFind']);
107 107
 	}
108 108
 
109 109
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
 			// Dealing with the 'share' document, which modified invitees on a
148 148
 			// calendar.
149
-			case '{' . self::NS_OWNCLOUD . '}share' :
149
+			case '{'.self::NS_OWNCLOUD.'}share' :
150 150
 
151 151
 				// We can only deal with IShareableCalendar objects
152 152
 				if (!$node instanceof IShareable) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	function propFind(PropFind $propFind, INode $node) {
190 190
 		if ($node instanceof IShareable) {
191 191
 
192
-			$propFind->handle('{' . Plugin::NS_OWNCLOUD . '}invite', function() use ($node) {
192
+			$propFind->handle('{'.Plugin::NS_OWNCLOUD.'}invite', function() use ($node) {
193 193
 				return new Invite(
194 194
 					$node->getShares()
195 195
 				);
Please login to merge, or discard this patch.