Completed
Push — master ( 029fc1...afa99c )
by guillaume
12:29 queued 06:09
created

TransformRequestLoginProvider   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 18 3
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use Closure;
6
7
class TransformRequestLoginProvider
8
{
9
    public function handle($request, Closure $next, $guard = null)
0 ignored issues
show
Unused Code introduced by
The parameter $guard is not used and could be removed. ( Ignorable by Annotation )

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

9
    public function handle($request, Closure $next, /** @scrutinizer ignore-unused */ $guard = null)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
    {
11
        $params = $request->all();
12
        if(isset($params['\code'])) {
13
            $request->merge([
14
                '\code' => null,
15
                'code' => $params['\code']
16
            ]);
17
        }
18
19
        if(isset($params['\oauth_token'])) {
20
            $request->merge([
21
                '\oauth_token' => null,
22
                'oauth_token' => $params['\oauth_token']
23
            ]);
24
        }
25
26
        return $next($request);
27
    }
28
}
29