Completed
Push — master ( 592d95...c00565 )
by Abdelrahman
18:11 queued 10s
created

AccessToken   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
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