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

Scope   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 42
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getIdentifier() 0 3 1
A setIdentifier() 0 3 1
A __construct() 0 3 1
A jsonSerialize() 0 3 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
}