Completed
Push — version-4 ( 511c26...6005c1 )
by
unknown
02:14
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
namespace Fenos\Notifynder\Senders;
3
4
use Fenos\Notifynder\Contracts\SenderContract;
5
use Fenos\Notifynder\Contracts\SenderManagerContract;
6
use Fenos\Notifynder\Models\Notification;
7
8
class SingleSender implements SenderContract
9
{
10
    protected $notification;
11
12
    public function __construct(array $notifications)
13
    {
14
        $this->notification = array_values($notifications)[0];
15
    }
16
17
    public function send(SenderManagerContract $sender)
18
    {
19
        $notification = new Notification($this->notification);
20
        return $notification->save();
21
    }
22
}