Completed
Branch develop (09eeba)
by Simon
01:32
created

MockYubiValidate::success()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
use Yubikey\Response;
3
use Yubikey\ResponseCollection;
4
use Yubikey\Validate;
5
6
7
class MockYubiValidate extends Validate
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
10
    public function check($otp, $multi = false)
11
    {
12
        $nonce = $this->generateNonce();
13
        $result = new Response(array(
14
            'h' => '',
15
            'otp' => $otp,
16
            'status' => 'OK',
17
            'nonce' => $nonce,
18
            'inputNonce' => $nonce,
19
            'inputOtp' => $otp,
20
            'host' => 'api.yubico.com',
21
            'sl' => 25,
22
            'timestamp' => time()
23
        ));
24
        return new ResponseCollection(array($result));
25
    }
26
27
}