MassMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A addRecipients() 0 4 1
A getRecipient() 0 4 1
A getMessage() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Pavel
5
 * Date: 2015-05-14
6
 * Time: 00:02
7
 */
8
9
namespace ScayTrase\WebSMS\Message;
10
11
use ScayTrase\WebSMS\Connection\WebSmsApiParams;
12
13
class MassMessage implements MessageInterface
14
{
15
    /** @var array */
16
    private $recipients = array();
17
    /** @var string */
18
    private $message;
19
20
    /**
21
     * MassMessage constructor.
22
     *
23
     * @param array  $recipients
24
     * @param string $message
25
     */
26
    public function __construct($message, array $recipients = array())
27
    {
28
        $this->recipients = $recipients;
29
        $this->message    = $message;
30
    }
31
32
    public function addRecipients($recipient)
33
    {
34
        $this->recipients[] = $recipient;
35
    }
36
37
    public function getRecipient()
38
    {
39
        return implode(WebSmsApiParams::PARAM_RecipientDelimiter, $this->recipients);
40
    }
41
42
    public function getMessage()
43
    {
44
        return $this->message;
45
    }
46
}
47