Push   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 6
c 1
b 1
f 0
dl 0
loc 45
ccs 9
cts 9
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A send() 0 3 1
A response() 0 3 1
A __construct() 0 3 1
A getAdapter() 0 3 1
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