Completed
Push — master ( f8f3cb...e8d4bf )
by Romain
9s
created

Push   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

4 Methods

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