SendCustomEmailVerificationNotification::handle()   A
last analyzed

Complexity

Conditions 5
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
rs 9.6111
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