AccessToken   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A convertToJWT() 0 7 1
1
<?php
2
3
4
namespace Mvdstam\Oauth2ServerLaravel\Entities;
5
6
7
use League\OAuth2\Server\CryptKey;
8
use League\OAuth2\Server\Entities\AccessTokenEntityInterface;
9
use Mvdstam\Oauth2ServerLaravel\Contracts\JWTFactoryInterface;
10
11
/**
12
 * @inheritdoc
13
 * Class AccessToken
14
 */
15
class AccessToken extends AbstractToken implements AccessTokenEntityInterface
16
{
17
18
    /**
19
     * @inheritdoc
20
     */
21 11
    public function convertToJWT(CryptKey $privateKey)
22
    {
23
        /** @var JWTFactoryInterface $jwtService */
24 11
        $jwtFactory = app(JWTFactoryInterface::class);
25
26 11
        return (string) $jwtFactory->getForAccessToken($this, $privateKey);
27
    }
28
29
}
30