AccessToken   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 26
rs 10
c 0
b 0
f 0
ccs 0
cts 6
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Entities;
4
5
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
6
use League\OAuth2\Server\Entities\ClientEntityInterface;
7
use League\OAuth2\Server\Entities\Traits\AccessTokenTrait;
8
use League\OAuth2\Server\Entities\Traits\EntityTrait;
9
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
10
11
class AccessToken implements AccessTokenEntityInterface
12
{
13
    use AccessTokenTrait;
14
    use EntityTrait;
15
    use TokenEntityTrait;
16
17
    /**
18
     * Create a new token instance.
19
     *
20
     * @param string                $userIdentifier
21
     * @param array                 $scopes
22
     * @param ClientEntityInterface $client
23
     *
24
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
25
     */
26
    public function __construct($userIdentifier, array $scopes, ClientEntityInterface $client)
27
    {
28
        $this->setUserIdentifier($userIdentifier);
29
30
        foreach ($scopes as $scope) {
31
            $this->addScope($scope);
32
        }
33
34
        $this->setClient($client);
35
    }
36
}
37