@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @return string |
| 61 | 61 | */ |
| 62 | 62 | public function getReceiptTypeName() { |
| 63 | - if(true === array_key_exists($this->receiptType, self::$receiptTypesToNames)) { |
|
| 63 | + if (true === array_key_exists($this->receiptType, self::$receiptTypesToNames)) { |
|
| 64 | 64 | return self::$receiptTypesToNames[$this->receiptType]; |
| 65 | 65 | } |
| 66 | 66 | return null; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function __toString() { |
| 83 | 83 | $cryptTool = CryptTool::getInstance(); |
| 84 | - $str = "Delivery receipt (" . $this->getReceiptTypeName() . "): "; |
|
| 84 | + $str = "Delivery receipt (".$this->getReceiptTypeName()."): "; |
|
| 85 | 85 | $hexMessageIds = array(); |
| 86 | 86 | foreach ($this->ackedMessageIds as $messageId) { |
| 87 | 87 | $hexMessageIds[] = $cryptTool->bin2hex($messageId); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * @param object $res |
| 51 | 51 | * @return LookupIdResult |
| 52 | 52 | */ |
| 53 | - public function parseResult($httpCode, $res){ |
|
| 53 | + public function parseResult($httpCode, $res) { |
|
| 54 | 54 | return new LookupIdResult($httpCode, $res); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | 80 | protected function getErrorMessageByErrorCode($httpCode) { |
| 81 | - switch($httpCode) { |
|
| 81 | + switch ($httpCode) { |
|
| 82 | 82 | case 401: |
| 83 | 83 | return 'API identity or secret incorrect'; |
| 84 | 84 | case 404: |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | 80 | protected function getErrorMessageByErrorCode($httpCode) { |
| 81 | - switch($httpCode) { |
|
| 81 | + switch ($httpCode) { |
|
| 82 | 82 | case 401: |
| 83 | 83 | return 'API identity or secret incorrect'; |
| 84 | 84 | case 404: |
@@ -2,11 +2,11 @@ discard block |
||
| 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 |
||
| 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 | }); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | define('MSGAPI_SDK_FEATURE_LEVEL', $sdkFeatLevel); |
| 33 | 33 | $cryptTool = Threema\MsgApi\Tools\CryptTool::getInstance(); |
| 34 | 34 | |
| 35 | -if(null === $cryptTool) { |
|
| 35 | +if (null === $cryptTool) { |
|
| 36 | 36 | throw new \Threema\Core\Exception("no supported crypt-tool"); |
| 37 | 37 | } |
| 38 | 38 | |