PayplugMalformedIPNEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRequest() 0 4 1
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