RequestHeadersFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 3 1
A name() 0 3 1
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
}