Completed
Pull Request — master (#44)
by rugk
02:40
created
source/Threema/MsgApi/Connection.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -202,12 +202,12 @@  discard block
 block discarded – undo
202 202
 			}
203 203
 		}
204 204
 		if ($tlsCipher = $this->setting->getTlsOption(ConnectionSettings::tlsOptionCipher, null)) {
205
-			if(true === is_string($tlsCipher)) {
205
+			if (true === is_string($tlsCipher)) {
206 206
 				$options[CURLOPT_SSL_CIPHER_LIST] = $tlsCipher;
207 207
 			}
208 208
 		}
209 209
 		if ($pinnedKey = $this->setting->getTlsOption(ConnectionSettings::tlsOptionPinnedKey, Constants::DEFAULT_PINNED_KEY)) {
210
-			if(true === is_string($pinnedKey)) {
210
+			if (true === is_string($pinnedKey)) {
211 211
 				$options[CURLOPT_PINNEDPUBLICKEY] = $pinnedKey;
212 212
 			}
213 213
 		}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		return $this->call($command->getPath(),
240 240
 			$this->createDefaultOptions($progress),
241 241
 			$params,
242
-			function ($httpCode, $response) use ($command) {
242
+			function($httpCode, $response) use ($command) {
243 243
 				return $command->parseResult($httpCode, $response);
244 244
 			});
245 245
 	}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		$options[CURLOPT_HTTPHEADER] = array(
258 258
 			'Content-Type: application/x-www-form-urlencoded');
259 259
 
260
-		return $this->call($command->getPath(), $options, null, function ($httpCode, $response) use ($command) {
260
+		return $this->call($command->getPath(), $options, null, function($httpCode, $response) use ($command) {
261 261
 			return $command->parseResult($httpCode, $response);
262 262
 		});
263 263
 	}
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 			'blob' => $command->getData()
278 278
 		);
279 279
 
280
-		return $this->call($command->getPath(), $options, $params, function ($httpCode, $response) use ($command) {
280
+		return $this->call($command->getPath(), $options, $params, function($httpCode, $response) use ($command) {
281 281
 			return $command->parseResult($httpCode, $response);
282 282
 		});
283 283
 	}
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 		$response = curl_exec($session);
306 306
 		if (false === $response) {
307
-			throw new Exception($path . ' ' . curl_error($session));
307
+			throw new Exception($path.' '.curl_error($session));
308 308
 		}
309 309
 
310 310
 		$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
Please login to merge, or discard this patch.
source/Threema/MsgApi/ConnectionSettings.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,20 +49,20 @@
 block discarded – undo
49 49
 		$this->host = $host;
50 50
 
51 51
 		// TLS options
52
-		if(null !== $tlsOptions && is_array($tlsOptions)) {
53
-			if(true === array_key_exists(self::tlsOptionForceHttps, $tlsOptions)) {
52
+		if (null !== $tlsOptions && is_array($tlsOptions)) {
53
+			if (true === array_key_exists(self::tlsOptionForceHttps, $tlsOptions)) {
54 54
 				$this->tlsOptions[self::tlsOptionForceHttps] = $tlsOptions[self::tlsOptionForceHttps] === true;
55 55
 			}
56 56
 
57
-			if(true === array_key_exists(self::tlsOptionVersion, $tlsOptions)) {
57
+			if (true === array_key_exists(self::tlsOptionVersion, $tlsOptions)) {
58 58
 				$this->tlsOptions[self::tlsOptionVersion] = $tlsOptions[self::tlsOptionVersion];
59 59
 			}
60 60
 
61
-			if(true === array_key_exists(self::tlsOptionCipher, $tlsOptions)) {
61
+			if (true === array_key_exists(self::tlsOptionCipher, $tlsOptions)) {
62 62
 				$this->tlsOptions[self::tlsOptionCipher] = $tlsOptions[self::tlsOptionCipher];
63 63
 			}
64 64
 
65
-			if(true === array_key_exists(self::tlsOptionPinnedKey, $tlsOptions)) {
65
+			if (true === array_key_exists(self::tlsOptionPinnedKey, $tlsOptions)) {
66 66
 				$this->tlsOptions[self::tlsOptionPinnedKey] = $tlsOptions[self::tlsOptionPinnedKey];
67 67
 			}
68 68
 		}
Please login to merge, or discard this patch.
source/bootstrap.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,11 +2,11 @@  discard block
 block discarded – undo
2 2
 require_once("Salt/autoload.php");
3 3
 
4 4
 //define possibly missing constants
5
-defined('CURL_SSLVERSION_DEFAULT')  || define('CURL_SSLVERSION_DEFAULT', 0);
6
-defined('CURL_SSLVERSION_TLSv1')    || define('CURL_SSLVERSION_TLSv1', 1);
7
-defined('CURL_SSLVERSION_TLSv1_1')  || define('CURL_SSLVERSION_TLSv1_1', 5);
8
-defined('CURL_SSLVERSION_TLSv1_2')  || define('CURL_SSLVERSION_TLSv1_2', 6);
9
-defined('CURLOPT_PINNEDPUBLICKEY')  || define('CURLOPT_PINNEDPUBLICKEY', 10230);
5
+defined('CURL_SSLVERSION_DEFAULT') || define('CURL_SSLVERSION_DEFAULT', 0);
6
+defined('CURL_SSLVERSION_TLSv1') || define('CURL_SSLVERSION_TLSv1', 1);
7
+defined('CURL_SSLVERSION_TLSv1_1') || define('CURL_SSLVERSION_TLSv1_1', 5);
8
+defined('CURL_SSLVERSION_TLSv1_2') || define('CURL_SSLVERSION_TLSv1_2', 6);
9
+defined('CURLOPT_PINNEDPUBLICKEY') || define('CURLOPT_PINNEDPUBLICKEY', 10230);
10 10
 
11 11
 //define autoloader
12 12
 $d = dirname(__FILE__);
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 	$fileName  = '';
17 17
 	if ($lastNsPos = strrpos($className, '\\')) {
18 18
 		$namespace = substr($className, 0, $lastNsPos);
19
-		$className = substr($className, $lastNsPos + 1);
20
-		$fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
19
+		$className = substr($className, $lastNsPos+1);
20
+		$fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR;
21 21
 	}
22
-	$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
22
+	$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
23 23
 
24
-	if(true === file_exists( $d.'/'.$fileName)) {
24
+	if (true === file_exists($d.'/'.$fileName)) {
25 25
 		require $d.'/'.$fileName;
26 26
 	}
27 27
 });
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 define('MSGAPI_SDK_VERSION', $sdkVersion);
31 31
 $cryptTool = Threema\MsgApi\Tools\CryptTool::getInstance();
32 32
 
33
-if(null === $cryptTool) {
33
+if (null === $cryptTool) {
34 34
 	throw new \Threema\Core\Exception("no supported crypt-tool");
35 35
 }
36 36
 
Please login to merge, or discard this patch.