PlainVerifier   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A verifyCodeChallenge() 0 3 1
1
<?php
2
3
/**
4
 * @author      Lukáš Unger <[email protected]>
5
 * @copyright   Copyright (c) Lukáš Unger
6
 * @license     http://mit-license.org/
7
 *
8
 * @link        https://github.com/thephpleague/oauth2-server
9
 */
10
11
declare(strict_types=1);
12
13
namespace League\OAuth2\Server\CodeChallengeVerifiers;
14
15
use function hash_equals;
16
17
class PlainVerifier implements CodeChallengeVerifierInterface
18
{
19
    /**
20
     * Return code challenge method.
21
     */
22 54
    public function getMethod(): string
23
    {
24 54
        return 'plain';
25
    }
26
27
    /**
28
     * Verify the code challenge.
29
     */
30 3
    public function verifyCodeChallenge(string $codeVerifier, string $codeChallenge): bool
31
    {
32 3
        return hash_equals($codeVerifier, $codeChallenge);
33
    }
34
}
35