GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

OnAssembleResponseEvent   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 69
rs 10
c 0
b 0
f 0
ccs 15
cts 15
cp 1

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getException() 0 4 1
A getUser() 0 4 1
A isSuccess() 0 4 1
A getResponse() 0 4 1
A setResponse() 0 4 1
1
<?php
2
3
namespace Ma27\ApiKeyAuthenticationBundle\Event;
4
5
use Ma27\ApiKeyAuthenticationBundle\Exception\CredentialException;
6
use Symfony\Component\EventDispatcher\Event;
7
use Symfony\Component\HttpFoundation\JsonResponse;
8
9
/**
10
 * AssembleResponseEvent.
11
 *
12
 * Event which handles response creation.
13
 */
14
class OnAssembleResponseEvent extends Event
15
{
16
    /**
17
     * @var CredentialException
18
     */
19
    private $exception;
20
21
    /**
22
     * @var null|object
23
     */
24
    private $user;
25
26
    /**
27
     * @var JsonResponse
28
     */
29
    private $response;
30
31
    /**
32
     * Constructor.
33
     *
34
     * @param object              $user
35
     * @param CredentialException $exception
36
     */
37 14
    public function __construct($user = null, CredentialException $exception = null)
38
    {
39 14
        $this->exception = $exception;
40 14
        $this->user = $user;
41 14
    }
42
43
    /**
44
     * @return CredentialException
45
     */
46 5
    public function getException()
47
    {
48 5
        return $this->exception;
49
    }
50
51
    /**
52
     * @return object
53
     */
54 9
    public function getUser()
55
    {
56 9
        return $this->user;
57
    }
58
59
    /**
60
     * @return bool
61
     */
62 14
    public function isSuccess()
63
    {
64 14
        return $this->exception === null;
65
    }
66
67
    /**
68
     * @return JsonResponse
69
     */
70 14
    public function getResponse()
71
    {
72 14
        return $this->response;
73
    }
74
75
    /**
76
     * @param JsonResponse $response
77
     */
78 14
    public function setResponse(JsonResponse $response)
79
    {
80 14
        $this->response = $response;
81 14
    }
82
}
83