UserUnsubscribed   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A via() 0 4 1
A toMail() 0 6 1
1
<?php
2
3
namespace Neo\EarlyAccess\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Neo\EarlyAccess\Subscriber;
7
use Illuminate\Notifications\Notification;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Notifications\Messages\MailMessage;
10
11
class UserUnsubscribed extends Notification implements ShouldQueue
12
{
13
    use Queueable;
14
15
    /**
16
     * @var \Neo\EarlyAccess\Subscriber
17
     */
18
    public $subscriber;
19
20
    /**
21
     * Create a new notification instance.
22
     *
23
     * @param  \Neo\EarlyAccess\Subscriber $subscriber
24
     */
25
    public function __construct(Subscriber $subscriber)
26
    {
27
        $this->subscriber = $subscriber;
28
    }
29
30
    /**
31
     * Get the notification's delivery channels.
32
     *
33
     * @return array
34
     */
35
    public function via()
36
    {
37
        return ['mail'];
38
    }
39
40
    /**
41
     * Get the mail representation of the notification.
42
     *
43
     * @return \Illuminate\Notifications\Messages\MailMessage
44
     */
45
    public function toMail()
46
    {
47
        return (new MailMessage)
48
            ->subject(trans('early-access::mail.unsubscribed.subject', ['name' => config('app.name')]))
49
            ->line(trans('early-access::mail.unsubscribed.message.intro'));
50
    }
51
}
52