Completed
Push — master ( 2949e5...9628d6 )
by Derek Stephen
02:24
created

Scope::getIdentifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace OAuth;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use League\OAuth2\Server\Entities\ScopeEntityInterface;
7
8
/**
9
* @Entity(repositoryClass="OAuth\Repository\ScopeRepository")
10
* @Table(name="Scope")
11
*/
12
class Scope implements ScopeEntityInterface
13
{
14
    /**
15
     * @var string
16
     * @Id
17
     * @Column(type="string", length=40)
18
     */
19
    protected $identifier;
20
21
    /**
22
     * @var ArrayCollection $accessTokens
23
     * @ManyToMany(targetEntity="AccessToken", mappedBy="scopes")
24
     */
25
    protected $accessTokens;
26
27 4
    public function __construct()
28
    {
29 4
        $this->accessTokens = new ArrayCollection();
30 4
    }
31
32
    /**
33
     * @return string
34
     */
35 4
    public function getIdentifier()
36
    {
37 4
        return $this->identifier;
38
    }
39
40
    /**
41
     * @param string $identifier
42
     */
43 4
    public function setIdentifier($identifier)
44
    {
45 4
        $this->identifier = $identifier;
46 4
    }
47
48
    /**
49
     * @return string
50
     */
51 1
    function jsonSerialize()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
52
    {
53 1
        return $this->getIdentifier();
54
    }
55
}