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

Client::isTypeEqualsTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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