Passed
Push — master ( 5d259d...069a18 )
by Conrad
02:00
created

AccessToken::getMember()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AdvancedLearning\Oauth2Server\Models;
4
5
use SilverStripe\ORM\DataObject;
6
use SilverStripe\Security\Member;
7
8
/**
9
 * Class AccessToken
10
 *
11
 * @package AdvancedLearning\Oauth2Server\Models
12
 *
13
 * @property string $Identifier
14
 * @property string $Scopes
15
 * @property string $Name
16
 * @property string $ExpiryDatetime
17
 * @property bool   $Revoked
18
 */
19
class AccessToken extends DataObject
20
{
21
    private static $table_name = 'OauthAccessToken';
0 ignored issues
show
Comprehensibility introduced by Conrad Dobbs
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by Conrad Dobbs
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...
22
23
    private static $db = [
0 ignored issues
show
Comprehensibility introduced by Conrad Dobbs
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by Conrad Dobbs
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...
24
        'Identifier' => 'Varchar(255)',
25
        'Scopes' => 'Text',
26
        'Name' => 'Varchar(255)',
27
        'ExpireDateTime' => 'Datetime',
28
        'Revoked' => 'Boolean'
29
    ];
30
31
    private static $summary_fields = [
0 ignored issues
show
Comprehensibility introduced by Conrad Dobbs
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by Conrad Dobbs
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...
32
        'Name',
33
        'ExpireDateTime',
34
        'Revoked'
35
    ];
36
37
    /**
38
     * Get the Member associated with this AccessToken.
39
     *
40
     * @return Member
41
     */
42
    public function getMember()
43
    {
44
        return Member::get()->byID($this->Identifier);
45
    }
46
}
47