Completed
Pull Request — master (#8)
by Alessandro
03:55
created

LogEvent::setFilter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 2
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 array */
16
    private $filter;
17
18
    /** @var int */
19
    private $executionTime;
20
21
    /**
22
     * LogEvent constructor.
23
     */
24
    public function __construct()
25
    {
26
        $this->method = 'unknown';
27
        $this->filter = [];
28
        $this->executionTime = 0;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getMethod(): string
35
    {
36
        return $this->method;
37
    }
38
39
    /**
40
     * @param string $method
41
     */
42
    public function setMethod(string $method)
43
    {
44
        $this->method = $method;
45
    }
46
47
    /**
48
     * @return array
49
     */
50
    public function getFilter(): array
51
    {
52
        return $this->filter;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getFilterJson(): string
59
    {
60
        return json_encode($this->filter);
61
    }
62
63
    /**
64
     * @param array $filter
65
     */
66
    public function setFilter(array $filter)
67
    {
68
        $this->filter = $filter;
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getExecutionTime(): int
75
    {
76
        return $this->executionTime;
77
    }
78
79
    /**
80
     * @param int $executionTime
81
     */
82
    public function setExecutionTime(int $executionTime)
83
    {
84
        $this->executionTime = $executionTime;
85
    }
86
}
87
88