MockYubiValidateFalse   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 18 1
1
<?php
2
3
namespace Firesphere\YubiAuth\Tests;
4
5
use Yubikey\Response;
6
use Yubikey\ResponseCollection;
7
use Yubikey\Validate;
8
9
class MockYubiValidateFalse extends Validate
10
{
11
    public function check($otp, $multi = false)
12
    {
13
        $nonce = $this->generateNonce();
14
        $result = new Response(
15
            [
16
                'h'          => '',
17
                'otp'        => $otp,
18
                'status'     => 'REPLAYED_OTP',
19
                'nonce'      => $nonce,
20
                'inputNonce' => $nonce,
21
                'inputOtp'   => $otp,
22
                'host'       => 'api.yubico.com',
23
                'sl'         => 25,
24
                'timestamp'  => time()
25
            ]
26
        );
27
28
        return new ResponseCollection([$result]);
29
    }
30
}
31