| Total Complexity | 8 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 42.31% |
| 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 | private $threadId; |
||
| 16 | 58 | ||
| 17 | public function __construct( |
||
| 18 | EventInfo $eventInfo, |
||
| 19 | string $database, |
||
| 20 | int $executionTime, |
||
| 21 | string $query, |
||
| 22 | 58 | int $threadId |
|
| 23 | ) { |
||
| 24 | 58 | parent::__construct($eventInfo); |
|
| 25 | 58 | ||
| 26 | 58 | $this->executionTime = $executionTime; |
|
| 27 | 58 | $this->query = $query; |
|
| 28 | $this->database = $database; |
||
| 29 | $this->threadId = $threadId; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function getDatabase(): string |
||
| 33 | { |
||
| 34 | return $this->database; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function getExecutionTime(): int |
||
| 38 | { |
||
| 39 | 5 | return $this->executionTime; |
|
| 40 | } |
||
| 41 | 5 | ||
| 42 | public function getQuery(): string |
||
| 43 | { |
||
| 44 | 58 | return $this->query; |
|
| 45 | } |
||
| 46 | 58 | ||
| 47 | public function getType(): string |
||
| 48 | { |
||
| 49 | return $this->type; |
||
| 50 | } |
||
| 51 | |||
| 52 | public function getThreadId(): int |
||
| 55 | } |
||
| 56 | |||
| 57 | public function __toString(): string |
||
| 58 | { |
||
| 59 | return PHP_EOL . |
||
| 60 | '=== Event ' . $this->getType() . ' === ' . PHP_EOL . |
||
| 61 | 'Date: ' . $this->eventInfo->getDateTime() . PHP_EOL . |
||
| 62 | 'Log position: ' . $this->eventInfo->getPos() . PHP_EOL . |
||
| 63 | 'Event size: ' . $this->eventInfo->getSize() . PHP_EOL . |
||
| 64 | 'Database: ' . $this->database . PHP_EOL . |
||
| 65 | 1 | 'Execution time: ' . $this->executionTime . PHP_EOL . |
|
| 66 | 'Query: ' . $this->query . PHP_EOL; |
||
| 67 | } |
||
| 68 | |||
| 69 | public function jsonSerialize() |
||
| 72 | } |
||
| 73 | } |