AccessToken::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
ccs 0
cts 6
cp 0
cc 2
nc 2
nop 3
crap 6
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