UserProvider   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 5
dl 0
loc 14
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUserByEmail() 0 5 1
A isBanned() 0 5 3
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