getEmailForChangeEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace EmailChangeVerification\User;
4
5
use EmailChangeVerification\Notifications\EmailChangeNotification;
6
7
trait WithEmailChangeVerification
8
{
9
10
    /**
11
     * Get the e-mail address where email change verification links are sent.
12
     *
13
     * @return string
14
     */
15 14
    public function getEmailForChangeEmail(): string
16
    {
17 14
        return $this->email;
18
    }
19
20
    /**
21
     * Send the verification notification.
22
     *
23
     * @param string $token
24
     * @param string $newEmail
25
     *
26
     * @return void
27
     */
28 5
    public function sendEmailChangeNotification(string $token, string $newEmail): void
29
    {
30 5
        $this->notify(new EmailChangeNotification($token, $newEmail));
0 ignored issues
show
Bug introduced by
It seems like notify() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        $this->/** @scrutinizer ignore-call */ 
31
               notify(new EmailChangeNotification($token, $newEmail));
Loading history...
31
    }
32
}
33