Push::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Kerox\Push;
4
5
class Push
6
{
7
    /**
8
     * @var AdapterInterface
9
     */
10
    protected $adapter;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param AdapterInterface $adapter The adapter
16
     */
17 1
    public function __construct(AdapterInterface $adapter)
18
    {
19 1
        $this->adapter = $adapter;
20 1
    }
21
22
    /**
23
     * Get the Adapter.
24
     *
25
     * @return AdapterInterface adapter
26
     */
27 1
    public function getAdapter()
28
    {
29 1
        return $this->adapter;
30
    }
31
32
    /**
33
     * Send a downstream message to one or more devices.
34
     *
35
     * @return bool
36
     */
37 1
    public function send()
38
    {
39 1
        return $this->getAdapter()->send();
40
    }
41
42
    /**
43
     * Return the response of the push.
44
     *
45
     * @return \Psr\Http\Message\ResponseInterface
46
     */
47 1
    public function response()
48
    {
49 1
        return $this->getAdapter()->response();
50
    }
51
}
52