Passed
Push — shop ( c2aba6...5180ff )
by Fèvre
04:54
created

ShopItemNotification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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

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

37
    public function via(/** @scrutinizer ignore-unused */ $notifiable): array

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

Loading history...
38
    {
39
        return ['database'];
40
    }
41
42
    /**
43
     * Get the array representation of the notification.
44
     *
45
     * @param mixed $notifiable
46
     *
47
     * @return array
48
     */
49
    public function toDatabase($notifiable): array
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

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

49
    public function toDatabase(/** @scrutinizer ignore-unused */ $notifiable): array

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

Loading history...
50
    {
51
        return [
52
            'message' => 'You have bought the Xeticon <strong>%s</strong> !',
53
            'message_key' => [$this->item->title],
54
            'icon' => $this->item->item_icon,
55
            'type' => 'shop_item'
56
        ];
57
    }
58
}
59