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

LogEvent::setExecutionTime()   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 2
    public function __construct()
28
    {
29 2
        $this->collection = 'undefined';
30 2
        $this->method = 'undefined';
31 2
        $this->filter = [];
32 2
        $this->executionTime = 0;
33 2
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getCollection(): string
39
    {
40
        return $this->collection;
41
    }
42
43
    /**
44
     * @param string $collection
45
     */
46 1
    public function setCollection(string $collection)
47
    {
48 1
        $this->collection = $collection;
49 1
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getMethod(): string
55
    {
56
        return $this->method;
57
    }
58
59
    /**
60
     * @param string $method
61
     */
62
    public function setMethod(string $method)
63
    {
64
        $this->method = $method;
65
    }
66
67
    /**
68
     * @return array
69
     */
70
    public function getFilter(): array
71
    {
72
        return $this->filter;
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getFilterJson(): string
79
    {
80
        return json_encode($this->filter);
81
    }
82
83
    /**
84
     * @param array $filter
85
     */
86
    public function setFilter(array $filter)
87
    {
88
        $this->filter = $filter;
89
    }
90
91
    /**
92
     * @return int
93
     */
94 1
    public function getExecutionTime(): int
95
    {
96 1
        return $this->executionTime;
97
    }
98
99
    /**
100
     * @param int $executionTime
101
     */
102 1
    public function setExecutionTime(int $executionTime)
103
    {
104 1
        $this->executionTime = $executionTime;
105 1
    }
106
}
107
108