Conditions | 1 |
Paths | 1 |
Total Lines | 7 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
27 | 1 | public function asArray(Header $header, array $requestData, $path, $nonce) |
|
28 | { |
||
29 | 1 | $requestData["nonce"] = $nonce; |
|
30 | 1 | $postData = http_build_query($requestData, '', '&'); |
|
31 | 1 | $sign = hash_hmac('sha512', $path . hash('sha256', $nonce . $postData, true), base64_decode($header->getApiSign()), true); |
|
32 | |||
33 | 1 | return ["API-Key" => $header->getApiKey(), "API-Sign" => base64_encode($sign)]; |
|
34 | } |
||
36 |