Completed
Push — master ( 227046...968668 )
by Vitaliy
02:37
created

Sender::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the SmsGate package
7
 *
8
 * (c) SmsGate
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code
12
 */
13
14
namespace SmsGate\Sender;
15
16
use SmsGate\Adapter\AdapterInterface;
17
use SmsGate\Exception\SendSmsExceptionInterface;
18
use SmsGate\Message;
19
use SmsGate\Phone;
20
use SmsGate\ResultCollection;
21
22
/**
23
 * Default sender implementation.
24
 *
25
 *  @author Vitaliy Zhuk <[email protected]>
26
 */
27
class Sender implements SenderInterface
28
{
29
    /**
30
     * @var AdapterInterface
31
     */
32
    private $adapter;
33
34
    /**
35
     * Constructor.
36
     *
37
     * @param AdapterInterface $adapter
38
     */
39 1
    public function __construct(AdapterInterface $adapter)
40
    {
41 1
        $this->adapter = $adapter;
42 1
    }
43
44
    /**
45
     * {@inheritdoc}
46
     *
47
     * @throws SendSmsExceptionInterface
48
     */
49 1
    public function send(Message $message, Phone ...$recipients): ResultCollection
50
    {
51 1
        return $this->adapter->send($message, ...$recipients);
52
    }
53
}
54