Completed
Pull Request — master (#8)
by Alessandro
04:02
created

LogEvent::setCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\MongoDbBundle\Services\Loggers\Model;
6
7
/**
8
 * Class LogEvent.
9
 */
10
class LogEvent
11
{
12
    /** @var string */
13
    private $method;
14
15
    /** @var string */
16
    private $collection;
17
18
    /** @var array */
19
    private $filter;
20
21
    /** @var int */
22
    private $executionTime;
23
24
    /**
25
     * LogEvent constructor.
26
     */
27 3
    public function __construct()
28
    {
29 3
        $this->collection = 'undefined';
30 3
        $this->method = 'undefined';
31 3
        $this->filter = [];
32 3
        $this->executionTime = 0;
33 3
    }
34
35
    /**
36
     * @return string
37
     */
38 1
    public function getCollection(): string
39
    {
40 1
        return $this->collection;
41
    }
42
43
    /**
44
     * @param string $collection
45
     */
46 2
    public function setCollection(string $collection)
47
    {
48 2
        $this->collection = $collection;
49 2
    }
50
51
    /**
52
     * @return string
53
     */
54 1
    public function getMethod(): string
55
    {
56 1
        return $this->method;
57
    }
58
59
    /**
60
     * @param string $method
61
     */
62 1
    public function setMethod(string $method)
63
    {
64 1
        $this->method = $method;
65 1
    }
66
67
    /**
68
     * @return array
69
     */
70 1
    public function getFilter(): array
71
    {
72 1
        return $this->filter;
73
    }
74
75
    /**
76
     * @return string
77
     */
78 1
    public function getFilterJson(): string
79
    {
80 1
        return json_encode($this->filter);
81
    }
82
83
    /**
84
     * @param array $filter
85
     */
86 1
    public function setFilter(array $filter)
87
    {
88 1
        $this->filter = $filter;
89 1
    }
90
91
    /**
92
     * @return int
93
     */
94 2
    public function getExecutionTime(): int
95
    {
96 2
        return $this->executionTime;
97
    }
98
99
    /**
100
     * @param int $executionTime
101
     */
102 2
    public function setExecutionTime(int $executionTime)
103
    {
104 2
        $this->executionTime = $executionTime;
105 2
    }
106
}
107
108