| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function buildSignature(Request $request, Consumer $consumer, Token $token) |
||
| 31 | { |
||
| 32 | $signatureBase = $request->getSignatureBaseString(); |
||
| 33 | $parts = [$consumer->getSecret(), null !== $token ? $token->getSecret() : '']; |
||
| 34 | |||
| 35 | $parts = Util::urlencodeRFC3986($parts); |
||
| 36 | $key = implode('&', $parts); |
||
| 37 | |||
| 38 | return base64_encode(hash_hmac('sha1', $signatureBase, $key, true)); |
||
| 39 | } |
||
| 41 |