GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

HMAC::sign()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Gandung\JWT\Algorithm;
4
5
use Gandung\JWT\SignerInterface;
6
use Gandung\JWT\Manager\KeyManagerInterface;
7
8
/**
9
 * @author Paulus Gandung Prakosa <[email protected]>
10
 */
11
abstract class HMAC implements SignerInterface
12
{
13
   
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function sign($payload, KeyManagerInterface $key)
18
    {
19
        return \hash_hmac($this->getAlgorithm(), $payload, $key->getPassphrase(), true);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function verify($expected, $payload, KeyManagerInterface $key)
26
    {
27
        return \hash_equals($expected, $this->sign($payload, $key));
28
    }
29
}
30