Failed Conditions
Pull Request — master (#790)
by Guilherme
10:36 queued 05:09
created

NfgAccountCollisionException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAccessToken() 0 3 1
A setAccessToken() 0 5 1
A __construct() 0 4 1
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace PROCERGS\LoginCidadao\NfgBundle\Exception;
12
13
/**
14
 * NfgAccountCollisionException is thrown when an user tries to connect
15
 * its login-cidadao with an NFG account that is already linked to another user.
16
 *
17
 * @package PROCERGS\LoginCidadao\NfgBundle\Exception
18
 */
19
class NfgAccountCollisionException extends \RuntimeException
20
{
21
    /** @var string */
22
    private $accessToken;
23
24
    /**
25
     * NfgAccountCollisionException constructor.
26
     * @param string $accessToken
27
     * @param string $message
28
     * @param int $code
29
     * @param \Exception $previous
30
     */
31 2
    public function __construct($accessToken = null, $message = "", $code = 0, \Exception $previous = null)
32
    {
33 2
        parent::__construct($message, $code, $previous);
34 2
        $this->accessToken = $accessToken;
35 2
    }
36
37
    /**
38
     * @return string
39
     */
40 1
    public function getAccessToken()
41
    {
42 1
        return $this->accessToken;
43
    }
44
45
    /**
46
     * @param string $accessToken
47
     * @return NfgAccountCollisionException
48
     */
49 1
    public function setAccessToken($accessToken)
50
    {
51 1
        $this->accessToken = $accessToken;
52
53 1
        return $this;
54
    }
55
}
56