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

SingleSender   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

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