Completed
Pull Request — master (#28)
by
unknown
04:33
created

AccessToken   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 1
c 3
b 0
f 1
lcom 0
cbo 1
dl 0
loc 31
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUser() 0 4 1
1
<?php
2
3
namespace SMG\OauthBundle\Entity;
4
5
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity
10
 */
11
class AccessToken extends BaseAccessToken
12
{
13
    /**
14
     * @ORM\Id
15
     * @ORM\Column(type="integer")
16
     * @ORM\GeneratedValue(strategy="AUTO")
17
     */
18
    protected $id;
19
20
    /**
21
     * @ORM\ManyToOne(targetEntity="Client")
22
     * @ORM\JoinColumn(nullable=false)
23
     */
24
    protected $client;
25
26
    /**
27
     * @ORM\ManyToOne(targetEntity="SMG\UserBundle\Entity\User")
28
     * @ORM\JoinColumn(onDelete="CASCADE")
29
     */
30
    protected $user;
31
32
    /**
33
     * Return user identified by the token.
34
     *
35
     * @return SMG\UserBundle\Entity\User
36
     */
37 2
    public function getUser()
38
    {
39 2
        return $this->user;
40
    }
41
}
42