MagicLink::toMail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 5
c 2
b 1
f 0
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Soved\Laravel\Magic\Auth\Notifications;
4
5
use Illuminate\Notifications\Notification;
0 ignored issues
show
Bug introduced by
The type Illuminate\Notifications\Notification was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Notifications\Messages\MailMessage;
0 ignored issues
show
Bug introduced by
The type Illuminate\Notifications\Messages\MailMessage was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
class MagicLink extends Notification
9
{
10
    /**
11
     * The magic link.
12
     *
13
     * @var string
14
     */
15
    public $link;
16
17
    /**
18
     * Create a notification instance.
19
     *
20
     * @param string $link
21
     */
22
    public function __construct(string $link)
23
    {
24
        $this->link = $link;
25
    }
26
27
    /**
28
     * Get the notification's channels.
29
     *
30
     * @param mixed $notifiable
31
     *
32
     * @return string
33
     */
34
    public function via($notifiable)
35
    {
36
        return 'mail';
37
    }
38
39
    /**
40
     * Build the mail representation of the notification.
41
     *
42
     * @param mixed $notifiable
43
     *
44
     * @return \Illuminate\Notifications\Messages\MailMessage
45
     */
46
    public function toMail($notifiable)
47
    {
48
        return (new MailMessage())
49
            ->subject(__('Magic Authentication Notification'))
0 ignored issues
show
Bug introduced by
The function __ was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

49
            ->subject(/** @scrutinizer ignore-call */ __('Magic Authentication Notification'))
Loading history...
50
            ->line(__('You are receiving this email because we received a magic authentication request for your account.'))
51
            ->action(__('Login'), $this->link)
52
            ->line(__('If you did not request a magic link, no further action is required.'));
53
    }
54
}
55