PayplugMalformedIPNEvent::getRequest()   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
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Alcalyn\PayplugBundle\Event;
4
5
use Symfony\Component\HttpFoundation\Request;
6
7
class PayplugMalformedIPNEvent extends PayplugEvent
8
{
9
    /**
10
     * Event throw on a malformed IPN received.
11
     * 
12
     * The listener receive a PayplugMalformedIPNEvent event
13
     * 
14
     * @var string
15
     */
16
    const PAYPLUG_IPN_MALFORMED = 'event.payplug.ipn.malformed';
17
    
18
    /**
19
     * @var Request
20
     */
21
    private $request;
22
    
23
    /**
24
     * @param Request $request
25
     */
26
    public function __construct(Request $request)
0 ignored issues
show
Bug introduced by
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
27
    {
28
        $this->request = $request;
29
    }
30
    
31
    /**
32
     * Return the request responsible of the malformed IPN
33
     * 
34
     * @return Request
35
     */
36
    public function getRequest()
37
    {
38
        return $this->request;
39
    }
40
}
41