Event::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace SyncFS;
4
5
use SyncFS\Map\MapInterface;
6
7
/**
8
 * Class Event
9
 *
10
 * @package SyncFS
11
 * @author  Matej Velikonja <[email protected]>
12
 */
13
class Event implements EventInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    private $buffer;
19
20
    /**
21
     * @var MapInterface
22
     */
23
    private $map;
24
25
    /**
26
     * @param string       $buffer
27
     * @param MapInterface $map
28
     */
29 2
    public function __construct($buffer, MapInterface $map = null)
30
    {
31 2
        $this->buffer = $buffer;
32 2
        $this->map    = $map;
33 2
    }
34
35
36
    /**
37
     * @return string
38
     */
39 2
    public function getBuffer()
40
    {
41 2
        return $this->buffer;
42
    }
43
44
    /**
45
     * @param string $buffer
46
     *
47
     * @return $this
48
     */
49
    public function setBuffer($buffer)
50
    {
51
        $this->buffer = $buffer;
52
53
        return $this;
54
    }
55
56
    /**
57
     * @param \SyncFS\Map\MapInterface $map
58
     *
59
     * @return $this
60
     */
61
    public function setMap(MapInterface $map)
62
    {
63
        $this->map = $map;
64
65
        return $this;
66
    }
67
68
    /**
69
     * @return \SyncFS\Map\MapInterface
70
     */
71
    public function getMap()
72
    {
73
        return $this->map;
74
    }
75
}
76