RequestParamsFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A format() 0 4 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 RequestParamsFormatter 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->except(
0 ignored issues
show
Bug introduced by
The method except() 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 */ except(
Loading history...
19
            config('request-logger.param_exceptions')
20
        );
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function name(): string
27
    {
28
        return 'request_params';
29
    }
30
}