| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class AbstractHandler |
||
| 17 | { |
||
| 18 | const HASHING_ALGORITHM = 'sha256'; |
||
| 19 | |||
| 20 | const ENCODING_ALGORITHM = 'HS256'; |
||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $secretKey = 'notThatSecretReally-changeMe'; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $secretKey |
||
| 28 | * @return null |
||
| 29 | */ |
||
| 30 | 8 | public function setSecretKey(string $secretKey) |
|
| 33 | 8 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $header |
||
| 37 | * @param string $payload |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | 7 | protected function calculateSignature(string $header, string $payload): string |
|
| 52 |