Multi   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 59
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A asMulti() 0 3 1
A __construct() 0 5 1
A getMessage() 0 3 1
A getTo() 0 3 1
A useIconv() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kafkiansky\SmsRu\Message;
6
7
final class Multi extends Recipient
8
{
9
    /**
10
     * @var array
11
     */
12
    private $tos;
13
14
    /**
15
     * @var bool
16
     */
17
    private $useIconv;
18
19
    /**
20
     * @var string
21
     */
22
    private $message;
23
24
    /**
25
     * @param array<To> $tos
26
     * @param bool      $useIconv
27
     * @param string    $message
28
     */
29
    public function __construct(array $tos, bool $useIconv = false, string $message = '')
30
    {
31
        $this->tos = $tos;
32
        $this->useIconv = $useIconv;
33
        $this->message = $message;
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function getTo(): array
40
    {
41
        return $this->tos;
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getMessage(): string
48
    {
49
        return $this->message;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function useIconv(): bool
56
    {
57
        return $this->useIconv;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function asMulti(): bool
64
    {
65
        return true;
66
    }
67
}
68