UserProvider::isBanned()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
c 0
b 0
f 0
rs 10
cc 3
nc 2
nop 1
1
<?php
2
3
namespace Imanghafoori\TokenizedLogin;
4
5
use Illuminate\Foundation\Auth\User;
6
7
class UserProvider
8
{
9
    public function getUserByEmail($email)
10
    {
11
        $user = User::where('email', $email)->first();
12
13
        return nullable($user);
14
    }
15
16
    public function isBanned($uid)
17
    {
18
        $user = User::find($uid) ?: new User();
19
20
        return $user->is_ban == 1 ? true : false;
0 ignored issues
show
Bug introduced by
The property is_ban does not seem to exist on Illuminate\Foundation\Auth\User. Are you sure there is no database migration missing?

Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.

Loading history...
21
    }
22
}
23