RequestHeadersFormatter::name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace San4io\RequestLogger\Logger\ContextFormatters;
4
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use San4io\RequestLogger\Contracts\ContextFormatterContract;
8
9
class RequestHeadersFormatter implements ContextFormatterContract
10
{
11
    /**
12
     * @param \Illuminate\Http\Request $request
13
     * @param \Illuminate\Http\Response $response
14
     * @return array
15
     */
16
    public function format(Request $request, Response $response)
17
    {
18
        return $request->header();
0 ignored issues
show
Bug introduced by
The method header() does not exist on Symfony\Component\HttpFoundation\Request. It seems like you code against a sub-type of Symfony\Component\HttpFoundation\Request such as Illuminate\Http\Request. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $request->/** @scrutinizer ignore-call */ header();
Loading history...
19
    }
20
21
    /**
22
     * @return string
23
     */
24
    public function name(): string
25
    {
26
        return 'request_headers';
27
    }
28
}