RequestHandled::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CodexShaper\WP\Http\Events;
4
5
class RequestHandled
6
{
7
    /**
8
     * The request instance.
9
     *
10
     * @var \Illuminate\Http\Request
11
     */
12
    public $request;
13
14
    /**
15
     * The response instance.
16
     *
17
     * @var \Illuminate\Http\Response
18
     */
19
    public $response;
20
21
    /**
22
     * Create a new event instance.
23
     *
24
     * @param \Illuminate\Http\Request  $request
25
     * @param \Illuminate\Http\Response $response
26
     *
27
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
28
     */
29
    public function __construct($request, $response)
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...
30
    {
31
        $this->request = $request;
32
        $this->response = $response;
33
    }
34
}
35