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.

U2fServerGenerator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace LM\AuthAbstractor\U2f;
6
7
use LM\AuthAbstractor\Configuration\IApplicationConfiguration;
8
use Firehed\U2F\Server;
9
10
/**
11
 * This class is only a factory to create a Firehed Server object.
12
 *
13
 * @internal
14
 */
15
class U2fServerGenerator
16
{
17
    /** @var IApplicationConfiguration */
18
    private $appConfig;
19
20
    /**
21
     * @param IApplicationConfiguration $appConfig
22
     */
23
    public function __construct(IApplicationConfiguration $appConfig)
24
    {
25
        $this->appConfig = $appConfig;
26
    }
27
28
    /**
29
     * @return Server An instance of Firehed server.
30
     */
31
    public function getServer(): Server
32
    {
33
        $server = new Server();
34
        if (null === $this->appConfig->getU2fCertificates()) {
35
            $server->disableCAVerification();
36
        } else {
37
            $server->setTrustedCAs($this->appConfig->getU2fCertificates());
38
        }
39
        $server->setAppId($this->appConfig->getAppId());
40
41
        return $server;
42
    }
43
}
44