Total Complexity | 7 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 39.13% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class QueryDTO extends EventDTO |
||
10 | { |
||
11 | private $executionTime; |
||
12 | private $query; |
||
13 | private $database; |
||
14 | private $type = ConstEventsNames::QUERY; |
||
15 | |||
16 | 62 | public function __construct( |
|
17 | EventInfo $eventInfo, |
||
18 | string $database, |
||
19 | int $executionTime, |
||
20 | string $query |
||
21 | ) { |
||
22 | 62 | parent::__construct($eventInfo); |
|
23 | |||
24 | 62 | $this->executionTime = $executionTime; |
|
25 | 62 | $this->query = $query; |
|
26 | 62 | $this->database = $database; |
|
27 | } |
||
28 | |||
29 | public function getDatabase(): string |
||
32 | } |
||
33 | |||
34 | public function getExecutionTime(): int |
||
37 | } |
||
38 | |||
39 | 5 | public function getQuery(): string |
|
40 | { |
||
41 | 5 | return $this->query; |
|
42 | } |
||
43 | |||
44 | 62 | public function getType(): string |
|
47 | } |
||
48 | |||
49 | public function __toString(): string |
||
50 | { |
||
51 | return PHP_EOL . |
||
52 | '=== Event ' . $this->getType() . ' === ' . PHP_EOL . |
||
53 | 'Date: ' . $this->eventInfo->getDateTime() . PHP_EOL . |
||
54 | 'Log position: ' . $this->eventInfo->getPos() . PHP_EOL . |
||
55 | 'Event size: ' . $this->eventInfo->getSize() . PHP_EOL . |
||
56 | 'Database: ' . $this->database . PHP_EOL . |
||
57 | 'Execution time: ' . $this->executionTime . PHP_EOL . |
||
58 | 'Query: ' . $this->query . PHP_EOL; |
||
59 | } |
||
60 | |||
61 | public function jsonSerialize() |
||
64 | } |
||
65 | } |