Completed
Push — master ( 76453f...1c4278 )
by Julien
06:31
created

TraceablePushServer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 1
dl 0
loc 38
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A send() 0 5 1
A getSentMessages() 0 4 1
1
<?php
2
3
namespace Eole\Sandstone\Push\Debug;
4
5
use Eole\Sandstone\Push\PushServerInterface;
6
7
class TraceablePushServer implements TraceablePushServerInterface
8
{
9
    /**
10
     * @var PushServerInterface
11
     */
12
    private $pushServer;
13
14
    /**
15
     * @var string[]
16
     */
17
    private $sentMessages;
18
19
    /**
20
     * @param PushServerInterface $pushServer
21
     */
22
    public function __construct(PushServerInterface $pushServer)
23
    {
24
        $this->pushServer = $pushServer;
25
        $this->sentMessages = array();
26
    }
27
28
    /**
29
     * {@InheritDoc}
30
     */
31
    public function send($message)
32
    {
33
        $this->pushServer->send($message);
34
        $this->sentMessages []= $message;
35
    }
36
37
    /**
38
     * @return string[]
39
     */
40
    public function getSentMessages()
41
    {
42
        return $this->sentMessages;
43
    }
44
}
45