Passed
Push — master ( 82d9da...92dcc2 )
by Derek Stephen
03:51
created

Scope::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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