Completed
Push — version-4 ( a26cca...5903bf )
by
unknown
02:38
created

SingleSender::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Fenos\Notifynder\Senders;
4
5
use Fenos\Notifynder\Contracts\SenderContract;
6
use Fenos\Notifynder\Contracts\SenderManagerContract;
7
use Fenos\Notifynder\Models\Notification;
8
9
class SingleSender implements SenderContract
10
{
11
    protected $notification;
12
13
    public function __construct(array $notifications)
14
    {
15
        $this->notification = array_values($notifications)[0];
16
    }
17
18
    public function send(SenderManagerContract $sender)
19
    {
20
        $notification = new Notification($this->notification);
21
22
        return $notification->save();
23
    }
24
}
25