AccessToken::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Oauth\Bridge;
6
7
use League\OAuth2\Server\Entities\Traits\EntityTrait;
8
use League\OAuth2\Server\Entities\ClientEntityInterface;
9
use League\OAuth2\Server\Entities\Traits\AccessTokenTrait;
10
use League\OAuth2\Server\Entities\Traits\TokenEntityTrait;
11
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
12
13
class AccessToken implements AccessTokenEntityInterface
14
{
15
    use EntityTrait;
16
    use AccessTokenTrait;
17
    use TokenEntityTrait;
18
19
    /**
20
     * Create a new token instance.
21
     *
22
     * @param string                                               $userIdentifier
23
     * @param array                                                $scopes
24
     * @param \League\OAuth2\Server\Entities\ClientEntityInterface $client
25
     *
26
     * @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...
27
     */
28
    public function __construct($userIdentifier, array $scopes, ClientEntityInterface $client)
29
    {
30
        $this->setUserIdentifier($userIdentifier);
31
32
        foreach ($scopes as $scope) {
33
            $this->addScope($scope);
34
        }
35
36
        $this->setClient($client);
37
    }
38
}
39