@@ -76,7 +76,7 @@ |
||
76 | 76 | * @param object $res |
77 | 77 | * @return SendE2EResult |
78 | 78 | */ |
79 | - public function parseResult($httpCode, $res){ |
|
79 | + public function parseResult($httpCode, $res) { |
|
80 | 80 | return new SendE2EResult($httpCode, $res); |
81 | 81 | } |
82 | 82 | } |
@@ -76,7 +76,7 @@ |
||
76 | 76 | * @param object $res |
77 | 77 | * @return SendE2EResult |
78 | 78 | */ |
79 | - public function parseResult($httpCode, $res){ |
|
79 | + public function parseResult($httpCode, $res) { |
|
80 | 80 | return new SendE2EResult($httpCode, $res); |
81 | 81 | } |
82 | 82 | } |
@@ -76,7 +76,7 @@ |
||
76 | 76 | * @param object $res |
77 | 77 | * @return SendE2EResult |
78 | 78 | */ |
79 | - public function parseResult($httpCode, $res){ |
|
79 | + public function parseResult($httpCode, $res) { |
|
80 | 80 | return new SendE2EResult($httpCode, $res); |
81 | 81 | } |
82 | 82 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $this->assertNotNull($message); |
58 | 58 | $this->assertTrue($message instanceof TextMessage); |
59 | - if($message instanceof TextMessage) { |
|
59 | + if ($message instanceof TextMessage) { |
|
60 | 60 | $this->assertEquals($message->getText(), 'Dies ist eine Testnachricht. äöü'); |
61 | 61 | } |
62 | 62 | }); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | public function testDerivePublicKey() { |
95 | - $this->doTest(function(CryptTool $cryptTool, $prefix){ |
|
95 | + $this->doTest(function(CryptTool $cryptTool, $prefix) { |
|
96 | 96 | $publicKey = $cryptTool->derivePublicKey($cryptTool->hex2bin(Common::getPrivateKey(Constants::myPrivateKey))); |
97 | 97 | $myPublicKey = $cryptTool->hex2bin(Common::getPublicKey(Constants::myPublicKey)); |
98 | 98 | |
@@ -165,13 +165,13 @@ discard block |
||
165 | 165 | |
166 | 166 | // test different strings when comparing and get time needed |
167 | 167 | $result = []; |
168 | - foreach(array( |
|
169 | - 'length' => [$string1, $string1 . 'a'], |
|
168 | + foreach (array( |
|
169 | + 'length' => [$string1, $string1.'a'], |
|
170 | 170 | 'diff' => [$string1, $string2], |
171 | 171 | 'same' => [$string1, $string1] |
172 | 172 | ) as $testName => $strings) { |
173 | 173 | $timeElapsed = 0; |
174 | - for ($i=0; $i < 3; $i++) { |
|
174 | + for ($i = 0; $i < 3; $i++) { |
|
175 | 175 | $timeElapsed -= microtime(true); |
176 | 176 | $comparisonResult = $cryptTool->stringCompare($strings[0], $strings[1]); |
177 | 177 | $timeElapsed += microtime(true); |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | |
193 | 193 | // check timings |
194 | 194 | echo 'Timing test results with '.$prefix.':'.PHP_EOL; |
195 | - $timingRatio = $result['diff'][0] / $result['same'][0]; |
|
196 | - $absoluteDifference = abs($result['diff'][0] - $result['same'][0]); |
|
195 | + $timingRatio = $result['diff'][0]/$result['same'][0]; |
|
196 | + $absoluteDifference = abs($result['diff'][0]-$result['same'][0]); |
|
197 | 197 | echo 'timing ratio: '.$timingRatio.PHP_EOL; |
198 | 198 | echo 'absolute difference: '.$absoluteDifference.PHP_EOL; |
199 | 199 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function testRemoveVar() { |
214 | 214 | $this->doTest(function(CryptTool $cryptTool, $prefix) { |
215 | - foreach(array( |
|
215 | + foreach (array( |
|
216 | 216 | 'hex' => Constants::myPrivateKeyExtract, |
217 | 217 | 'bin' => $cryptTool->hex2bin(Constants::myPrivateKeyExtract) |
218 | 218 | ) as $key => $testVar) { |
@@ -226,12 +226,12 @@ discard block |
||
226 | 226 | } |
227 | 227 | |
228 | 228 | private function doTest(\Closure $c) { |
229 | - foreach(array( |
|
229 | + foreach (array( |
|
230 | 230 | 'Salt' => CryptTool::createInstance(CryptTool::TYPE_SALT), |
231 | 231 | 'Sodium' => CryptTool::createInstance(CryptTool::TYPE_SODIUM) |
232 | 232 | ) as $key => $instance) { |
233 | 233 | |
234 | - if($instance === null) { |
|
234 | + if ($instance === null) { |
|
235 | 235 | echo $key.": could not instance crypt tool\n"; |
236 | 236 | break; |
237 | 237 | } |