TokenAuthentication   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
3
4
namespace Dolibarr\Client\Security\Authentication;
5
6
use Webmozart\Assert\Assert;
7
8
/**
9
 * Token based authentication on the Dolibarr API.
10
 *
11
 * @author Laurent De Coninck <[email protected]>
12
 */
13
class TokenAuthentication extends AbstractAuthentication
14
{
15
16
    /**
17
     * @param string $token
18
     */
19
    public function __construct($token)
20
    {
21
        Assert::stringNotEmpty($token);
22
23
        parent::__construct();
24
        $this->addHeader('Dolapikey', $token);
25
    }
26
}
27