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

Scope   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

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