FreeMobileChannel::send()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
1
<?php
2
3
namespace Akibatech\FreeMobileSms\Notifications;
4
5
use Akibatech\FreeMobileSms\FreeMobileSms;
6
use Illuminate\Notifications\Notification;
7
8
/**
9
 * Class FreeMobileChannel
10
 *
11
 * @package Akibatech\FreeMobileSms\Notifications
12
 */
13
class FreeMobileChannel
14
{
15
    /**
16
     * @var FreeMobileSms
17
     */
18
    protected $client;
19
20
    //-------------------------------------------------------------------------
21
22
    /**
23
     * FreeMobileChannel constructor.
24
     *
25
     * @return  self
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
26
     */
27
    public function __construct(FreeMobileSms $client)
28
    {
29
        $this->client = $client;
30
    }
31
32
    //-------------------------------------------------------------------------
33
34
    /**
35
     * Send the given notification.
36
     *
37
     * @param   mixed  $notifiable
38
     * @param   \Illuminate\Notifications\Notification  $notification
39
     * @return  bool
40
     */
41
    public function send($notifiable, Notification $notification)
42
    {
43
        $message = $notification->toFreeMobile($notifiable);
44
45
        return $this->client->send($message->message) === 200;
46
    }
47
48
    //-------------------------------------------------------------------------
49
}
50