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.

KeyVerifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A verifyKeys() 0 8 2
1
<?php
2
3
namespace Gbowo\Adapter\Amplifypay\Traits;
4
5
use Gbowo\Adapter\Amplifypay\Exception\KeyMismatchException;
6
7
/**
8
 * An Amplifypay best practice is to verify if the returned `ApiKey` in a response (HTTP 200) matches what was passed
9
 * to them.
10
 * @see https://amplifypay.com/developers Verifying transactions
11
 * @author Lanre Adelowo <[email protected]>
12
 * Class KeyVerifier
13
 * @package Gbowo\Adapter\Amplifypay\Traits
14
 */
15
trait KeyVerifier
16
{
17
18
    /**
19
     * @param string $returnedKey
20
     * @param string $userKey
21
     * @throws \Gbowo\Adapter\Amplifypay\Exception\KeyMismatchException if the keys don't match
22
     */
23 5
    protected function verifyKeys(string $returnedKey, string $userKey)
24
    {
25 5
        if (strcmp($returnedKey, $userKey) !== 0) {
26 1
            throw new KeyMismatchException("Api keys don't match");
27
        }
28
29 4
        return;
30
    }
31
}
32