Completed
Pull Request — master (#10)
by Fèvre
04:25 queued 02:11
created

BadgeNotification::toDatabase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
namespace Xetaravel\Notifications;
3
4
use Illuminate\Bus\Queueable;
5
use Illuminate\Notifications\Notification;
6
7
class BadgeNotification extends Notification
8
{
9
    use Queueable;
10
11
    public $badge;
12
13
    /**
14
     * Create a new notification instance.
15
     */
16
    public function __construct($badge)
17
    {
18
        $this->badge = $badge;
19
    }
20
21
    /**
22
     * Get the notification's delivery channels.
23
     *
24
     * @param  mixed  $notifiable
25
     *
26
     * @return array
27
     */
28
    public function via($notifiable): array
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
29
    {
30
        return ['database'];
31
    }
32
33
    /**
34
     * Get the array representation of the notification.
35
     *
36
     * @param mixed $notifiable
37
     *
38
     * @return array
39
     */
40
    public function toDatabase($notifiable): array
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        return [
43
            'message' => 'You have unlock the badge <strong>%s</strong> !',
44
            'message_key' => $this->badge->name,
45
            'image' => $this->badge->image,
46
            'type' => 'badge'
47
        ];
48
    }
49
}
50