SendCustomEmailVerificationNotification   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 5
1
<?php
2
3
4
namespace App\Listeners;
5
6
7
use Illuminate\Auth\Events\Registered;
8
use Illuminate\Contracts\Auth\MustVerifyEmail;
9
10
class SendCustomEmailVerificationNotification
11
{
12
    public function handle(Registered $event)
13
    {
14
        if (($event->user->providers === null || empty($event->user->providers)) && $event->user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()) {
0 ignored issues
show
Bug introduced by
Accessing providers on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?
Loading history...
15
            $event->user->sendEmailVerificationNotification();
16
        }
17
    }
18
}
19