@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Threema GmbH |
|
4 | - * @copyright Copyright (c) 2015 Threema GmbH |
|
5 | - */ |
|
3 | + * @author Threema GmbH |
|
4 | + * @copyright Copyright (c) 2015 Threema GmbH |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | |
8 | 8 | namespace Threema\MsgApi\Tools; |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @author Threema GmbH |
|
4 | - * @copyright Copyright (c) 2015 Threema GmbH |
|
5 | - */ |
|
3 | + * @author Threema GmbH |
|
4 | + * @copyright Copyright (c) 2015 Threema GmbH |
|
5 | + */ |
|
6 | 6 | |
7 | 7 | |
8 | 8 | namespace Threema\MsgApi\Tools; |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public static function analyse($file) { |
16 | 16 | //check if file exists |
17 | - if(false === file_exists($file)) { |
|
17 | + if (false === file_exists($file)) { |
|
18 | 18 | return null; |
19 | 19 | } |
20 | 20 | |
21 | 21 | //is not a file |
22 | - if(false === is_file($file)) { |
|
22 | + if (false === is_file($file)) { |
|
23 | 23 | return null; |
24 | 24 | } |
25 | 25 | |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | |
29 | 29 | $mimeType = null; |
30 | 30 | //mime type getter |
31 | - if(function_exists('finfo_open')) { |
|
31 | + if (function_exists('finfo_open')) { |
|
32 | 32 | $finfo = finfo_open(FILEINFO_MIME_TYPE); |
33 | 33 | $mimeType = finfo_file($finfo, $file); |
34 | 34 | } |
35 | - else if(function_exists('mime_content_type')) { |
|
35 | + else if (function_exists('mime_content_type')) { |
|
36 | 36 | $mimeType = mime_content_type($file); |
37 | 37 | } |
38 | 38 | |
39 | 39 | //default mime type |
40 | - if(strlen($mimeType) == 0) { |
|
40 | + if (strlen($mimeType) == 0) { |
|
41 | 41 | //default mime type |
42 | 42 | $mimeType = 'application/octet-stream'; |
43 | 43 | } |
@@ -31,8 +31,7 @@ |
||
31 | 31 | if(function_exists('finfo_open')) { |
32 | 32 | $finfo = finfo_open(FILEINFO_MIME_TYPE); |
33 | 33 | $mimeType = finfo_file($finfo, $file); |
34 | - } |
|
35 | - else if(function_exists('mime_content_type')) { |
|
34 | + } else if(function_exists('mime_content_type')) { |
|
36 | 35 | $mimeType = mime_content_type($file); |
37 | 36 | } |
38 | 37 |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | $fileName = ''; |
10 | 10 | if ($lastNsPos = strrpos($className, '\\')) { |
11 | 11 | $namespace = substr($className, 0, $lastNsPos); |
12 | - $className = substr($className, $lastNsPos + 1); |
|
13 | - $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; |
|
12 | + $className = substr($className, $lastNsPos+1); |
|
13 | + $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR; |
|
14 | 14 | } |
15 | - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; |
|
15 | + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php'; |
|
16 | 16 | |
17 | - if(true === file_exists( $d.'/'.$fileName)) { |
|
17 | + if (true === file_exists($d.'/'.$fileName)) { |
|
18 | 18 | require $d.'/'.$fileName; |
19 | 19 | } |
20 | 20 | }); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | define('MSGAPI_SDK_VERSION', $sdkVersion); |
24 | 24 | $cryptTool = Threema\MsgApi\Tools\CryptTool::getInstance(); |
25 | 25 | |
26 | -if(null === $cryptTool) { |
|
26 | +if (null === $cryptTool) { |
|
27 | 27 | throw new \Threema\Core\Exception("no supported crypt-tool"); |
28 | 28 | } |
29 | 29 |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | //disallow using the cli tool in a web project |
9 | 9 | if ('cli' !== php_sapi_name() || null === $argv) { |
10 | 10 | //file not called from the cli |
11 | - die('please run ' . basename(__FILE__) . ' only in a cli. '. |
|
11 | + die('please run '.basename(__FILE__).' only in a cli. '. |
|
12 | 12 | 'To use the threema msgapi sdk in your web project, include the source/bootstrap.php or the threema_msgapi.phar file.'); |
13 | 13 | } |
14 | 14 | try { |
@@ -20,6 +20,6 @@ discard block |
||
20 | 20 | Threema\MsgApi\PublicKeyStores\PhpFile::create('keystore.php')); |
21 | 21 | $tool->run(); |
22 | 22 | } catch (\Threema\Core\Exception $exception) { |
23 | - echo "ERROR: " . $exception->getMessage() . "\n"; |
|
23 | + echo "ERROR: ".$exception->getMessage()."\n"; |
|
24 | 24 | die(); |
25 | 25 | } |