Conditions | 4 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 7 | public function encrypt($params = []) |
|
33 | { |
||
34 | 7 | if (isset($params['MACD']) === true) { |
|
35 | 5 | foreach (['DATA', 'MACD', 'returnCode', 'version'] as $key) { |
|
36 | 5 | if (isset($params[$key]) === true) { |
|
37 | 5 | unset($params[$key]); |
|
38 | 5 | } |
|
39 | 5 | } |
|
40 | 5 | $string = urldecode(http_build_query($params, '', ',')).','; |
|
41 | 5 | } else { |
|
42 | 2 | $string = json_encode($params, JSON_UNESCAPED_SLASHES); |
|
43 | } |
||
44 | |||
45 | 7 | return hash('sha256', $string.$this->key); |
|
46 | } |
||
47 | |||
64 |