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

TraceablePushServer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 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