RequestHandled   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

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