GcController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 11
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A actionSession() 0 9 1
1
<?php
2
namespace App\Console\Controller;
3
4
use App\Model\Session;
5
use Yii;
6
7
class GcController extends Controller
8
{
9
    public function actionSession()
10
    {
11
        $now = time();
12
        $deleted = Session::deleteAll([
13
            'AND',
14
            ['<', 'expire_time', $now],
15
            ['<', 'refresh_token_expire_time', $now]
16
        ]);
17
        $this->logAndPrint(sprintf('Deleted %d expired user sessions', $deleted));
18
    }
19
}
20