Completed
Push — master ( 817fef...b9c500 )
by Allan
06:04
created

Client   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setType() 0 6 1
A getType() 0 4 1
A setMeta() 0 6 1
A getMeta() 0 4 1
A isTypeEqualsTo() 0 4 1
1
<?php
2
3
namespace SMG\OauthBundle\Entity;
4
5
use FOS\OAuthServerBundle\Entity\Client as BaseClient;
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity
10
 */
11
class Client extends BaseClient
12
{
13
    /**
14
     * @ORM\Id
15
     * @ORM\Column(type="integer")
16
     * @ORM\GeneratedValue(strategy="AUTO")
17
     */
18
    protected $id;
19
20
    /**
21
     * @ORM\Column(type="string")
22
     */
23
    public $type;
24
25
    /**
26
     * @ORM\Column(type="json_array", nullable=true)
27
     */
28
    public $meta;
29
30
    public function __construct()
31
    {
32
        parent::__construct();
33
    }
34
35
    public function setType($type)
36
    {
37
        $this->type = $type;
38
39
        return $this;
40
    }
41
42
    public function getType()
43
    {
44
        return $this->type;
45
    }
46
47
    public function setMeta($meta)
48
    {
49
        $this->meta = $meta;
50
51
        return $this;
52
    }
53
54
    public function getMeta()
55
    {
56
        return $this->meta;
57
    }
58
59
    /**
60
     * Check if the given client type is the same as the current user.
61
     *
62
     * @param string $typeToCheck client type to check
63
     *
64
     * @return bool
65
     */
66
    public function isTypeEqualsTo($typeToCheck)
67
    {
68
        return $this->getType() === $typeToCheck;
69
    }
70
}
71