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.
Completed
Push — master ( fe7ab2...0db119 )
by Maximilian
12:53
created

AssembleResponseEvent::isSuccess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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 AssembleResponseEvent 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
    public function __construct($user = null, CredentialException $exception = null)
38
    {
39
        $this->exception = $exception;
40
        $this->user      = $user;
41
    }
42
43
    /**
44
     * @return CredentialException
45
     */
46
    public function getException()
47
    {
48
        return $this->exception;
49
    }
50
51
    /**
52
     * @return object
53
     */
54
    public function getUser()
55
    {
56
        return $this->user;
57
    }
58
59
    /**
60
     * @return bool
61
     */
62
    public function isSuccess()
63
    {
64
        return $this->exception === null;
65
    }
66
67
    /**
68
     * @return JsonResponse
69
     */
70
    public function getResponse()
71
    {
72
        return $this->response;
73
    }
74
75
    /**
76
     * @param JsonResponse $response
77
     */
78
    public function setResponse(JsonResponse $response)
79
    {
80
        $this->response = $response;
81
    }
82
}
83