• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Moln / php-mysql-replication / 7579707553

19 Jan 2024 05:07AM CUT coverage: 80.809% (-0.02%) from 80.826%
7579707553

push

github

web-flow
Merge branch `krowinski master`  (#16)

* Sync `krowinski:master` into master:

- Fix JsonBinaryDecoder when there is NULL in data or if there is long.
- Preserve threadId in QUERY_EVENT.

* Fix CS

---------

Co-authored-by: xiemaomao <xiemaomao@enjoymi.com>

1259 of 1558 relevant lines covered (80.81%)

26.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.84
/src/MySQLReplication/Event/DTO/QueryDTO.php
1
<?php
2
declare(strict_types=1);
3

4
namespace MySQLReplication\Event\DTO;
5

6
use MySQLReplication\Definitions\ConstEventsNames;
7
use MySQLReplication\Event\EventInfo;
8

9
class QueryDTO extends EventDTO
10
{
11
    private $executionTime;
12
    private $query;
13
    private $database;
14
    private $type = ConstEventsNames::QUERY;
15
    private $threadId;
16

17
    public function __construct(
18
        EventInfo $eventInfo,
19
        string $database,
20
        int $executionTime,
21
        string $query,
22
        int $threadId = 0
23
    ) {
24
        parent::__construct($eventInfo);
62✔
25

26
        $this->executionTime = $executionTime;
62✔
27
        $this->query = $query;
62✔
28
        $this->database = $database;
62✔
29
        $this->threadId = $threadId;
62✔
30
    }
31

32
    public function getDatabase(): string
33
    {
34
        return $this->database;
×
35
    }
36

37
    public function getExecutionTime(): int
38
    {
39
        return $this->executionTime;
×
40
    }
41

42
    public function getQuery(): string
43
    {
44
        return $this->query;
5✔
45
    }
46

47
    public function getType(): string
48
    {
49
        return $this->type;
62✔
50
    }
51

52
    public function getThreadId(): int
53
    {
54
        return $this->threadId;
×
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
            'Execution time: ' . $this->executionTime . PHP_EOL .
×
66
            'Query: ' . $this->query . PHP_EOL;
×
67
    }
68

69
    #[\ReturnTypeWillChange]
70
    public function jsonSerialize()
71
    {
72
        return get_object_vars($this);
×
73
    }
74
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc