Sender::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types = 1);
4
5
/*
6
 * This file is part of the AppleApnPush package
7
 *
8
 * (c) Vitaliy Zhuk <[email protected]>
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 Apple\ApnPush\Sender;
15
16
use Apple\ApnPush\Model\Notification;
17
use Apple\ApnPush\Model\Receiver;
18
use Apple\ApnPush\Protocol\ProtocolInterface;
19
20
/**
21
 * Default notification sender
22
 */
23
class Sender implements SenderInterface
24
{
25
    /**
26
     * @var ProtocolInterface
27
     */
28
    private $protocol;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param ProtocolInterface $protocol
34
     */
35
    public function __construct(ProtocolInterface $protocol)
36
    {
37
        $this->protocol = $protocol;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function send(Receiver $receiver, Notification $notification, bool $sandbox = false): void
44
    {
45
        $this->protocol->send($receiver, $notification, $sandbox);
46
    }
47
}
48