Passed
Push — master ( feb246...605e0e )
by Conrad
01:29
created

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 3
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMember() 0 4 1
1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Models;
4
5
use SilverStripe\ORM\DataObject;
6
use SilverStripe\Security\Member;
7
8
/**
9
 * Class AccessTokenEntity
10
 *
11
 * @package AdvancedLearning\Oauth2Server\Models
12
 *
13
 * @property int    $ID
14
 * @property string $Identifier
15
 * @property string $Scopes
16
 * @property string $Name
17
 * @property string $ExpiryDateTime
18
 * @property bool   $Revoked
19
 */
20
class AccessToken extends DataObject
21
{
22
    private static $table_name = 'OauthAccessToken';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $table_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
23
24
    private static $db = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
25
        'Identifier' => 'Varchar(255)',
26
        'Scopes' => 'Text',
27
        'Name' => 'Varchar(255)',
28
        'ExpireDateTime' => 'Datetime',
29
        'Revoked' => 'Boolean'
30
    ];
31
32
    private static $summary_fields = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $summary_fields is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
33
        'Name',
34
        'ExpireDateTime',
35
        'Revoked'
36
    ];
37
38
    /**
39
     * Get the Member associated with this AccessTokenEntity.
40
     *
41
     * @return Member
42
     */
43
    public function getMember()
44
    {
45
        return Member::get()->byID($this->Identifier);
46
    }
47
}
48