Passed
Push — master ( de5894...b396dd )
by Conrad
07:34
created

AccessTokenEntity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Entities;
4
5
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
6
use League\OAuth2\Server\Entities\Traits\AccessTokenTrait;
7
use League\OAuth2\Server\Entities\Traits\EntityTrait;
8
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
9
10
class AccessTokenEntity implements AccessTokenEntityInterface
11
{
12
    use TokenEntityTrait, EntityTrait, AccessTokenTrait;
13
14
    /**
15
     * AccessTokenEntity constructor.
16
     *
17
     * @param null|string $userIdentifier The identifier of the user.
18
     * @param array       $scopes         The scopes to assign the user.
19
     */
20
    public function __construct(?string $userIdentifier, array $scopes)
21
    {
22
        $this->setUserIdentifier($userIdentifier);
23
24
        foreach ($scopes as $scope) {
25
            $this->addScope($scope);
26
        }
27
    }
28
}
29