Completed
Pull Request — master (#28)
by
unknown
08:48 queued 04:19
created

Client   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setType() 0 6 1
A getType() 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 2
    public function __construct()
26
    {
27 2
        parent::__construct();
28 2
    }
29
30 2
    public function setType($type)
31
    {
32 2
        $this->type = $type;
33
34 2
        return $this;
35
    }
36
37 2
    public function getType()
38
    {
39 2
        return $this->type;
40
    }
41
42
    /**
43
     * Check if the given client type is the same as the current user.
44
     *
45
     * @param string $typeToCheck client type to check
46
     *
47
     * @return bool
48
     */
49 2
    public function isTypeEqualsTo($typeToCheck)
50 1
    {
51 2
        return $this->getType() === $typeToCheck;
52
    }
53
}
54