Completed
Push — version-4 ( 511c26...6005c1 )
by
unknown
02:14
created

SingleSender   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 15
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 5 1
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
}