MakeRefreshCookieTask   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 15 1
1
<?php
2
3
namespace App\Containers\Authentication\Tasks;
4
5
use App\Ship\Parents\Tasks\Task;
6
use Illuminate\Support\Facades\Config;
7
8
/**
9
 * Class MakeRefreshCookieTask
10
 *
11
 * @author  Mahmoud Zalt  <[email protected]>
12
 */
13
class MakeRefreshCookieTask extends Task
14
{
15
16
    /**
17
     * @param $refreshToken
18
     *
19
     * @return  \Symfony\Component\HttpFoundation\Cookie
20
     */
21
    public function run($refreshToken)
22
    {
23
        // Save the refresh token in a HttpOnly cookie to minimize the risk of XSS attacks
24
        $refreshCookie = cookie(
0 ignored issues
show
Bug Compatibility introduced by Mahmoud Zalt
The expression cookie('refreshToken', $...ll, null, false, true); of type Illuminate\Cookie\Cookie...t\HttpFoundation\Cookie adds the type Illuminate\Cookie\CookieJar to the return on line 34 which is incompatible with the return type documented by App\Containers\Authentic...eRefreshCookieTask::run of type Symfony\Component\HttpFoundation\Cookie.
Loading history...
25
            'refreshToken',
26
            $refreshToken,
27
            Config::get('apiato.api.refresh-expires-in'),
28
            null,
29
            null,
30
            false,
31
            true // HttpOnly
32
        );
33
34
        return $refreshCookie;
35
    }
36
}
37