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.

PreTransactionEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EightPoints\Bundle\GuzzleBundle\Events;
4
5
use Psr\Http\Message\RequestInterface;
6
7
class PreTransactionEvent extends Event
8
{
9
    /** @var \Psr\Http\Message\RequestInterface */
10
    protected $requestTransaction;
11
12
    /** @var string */
13
    protected $serviceName;
14
15
    /**
16
     * @param \Psr\Http\Message\RequestInterface $requestTransaction
17
     * @param string $serviceName
18
     */
19
    public function __construct(RequestInterface $requestTransaction, string $serviceName)
20
    {
21
        $this->requestTransaction = $requestTransaction;
22
        $this->serviceName = $serviceName;
23
    }
24
25
    /**
26
     * Access the transaction from the Guzzle HTTP request
27
     *
28
     * This returns the actual Request Object from the Guzzle HTTP Request.
29
     * This object will be modified by the event listener.
30
     *
31
     * @return \Psr\Http\Message\RequestInterface
32
     */
33
    public function getTransaction() : RequestInterface
34
    {
35
        return $this->requestTransaction;
36
    }
37
38
    /**
39
     * Replaces the transaction with the modified one.
40
     *
41
     * Guzzles transaction returns a modified request object,
42
     * so once it has been modified, we need to put it back on the
43
     * event so it can become part of the transaction.
44
     *
45
     * @param \Psr\Http\Message\RequestInterface $requestTransaction
46
     *
47
     * @return void
48
     */
49
    public function setTransaction(RequestInterface $requestTransaction) : void
50
    {
51
        $this->requestTransaction = $requestTransaction;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getServiceName() : string
58
    {
59
        return $this->serviceName;
60
    }
61
}
62