Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | /** |
3 | * This file is part of the sshilko/php-sql-mydb package. |
4 | * |
5 | * (c) Sergei Shilko <contact@sshilko.com> |
6 | * |
7 | * MIT License |
8 | * |
9 | * For the full copyright and license information, please view the LICENSE |
10 | * file that was distributed with this source code. |
11 | * @license https://opensource.org/licenses/mit-license.php MIT |
12 | */ |
13 | |
14 | declare(strict_types = 1); |
15 | |
16 | namespace sql; |
17 | |
18 | use mysqli; |
19 | use mysqli_result; |
20 | use sql\MydbMysqli\MydbMysqliEscapeStringInterface; |
21 | use sql\MydbMysqli\MydbMysqliResultInterface; |
22 | |
23 | /** |
24 | * @author Sergei Shilko <contact@sshilko.com> |
25 | * @license https://opensource.org/licenses/mit-license.php MIT |
26 | * @see https://github.com/sshilko/php-sql-mydb |
27 | */ |
28 | interface MydbMysqliInterface extends MydbMysqliEscapeStringInterface |
29 | { |
30 | |
31 | public function init(): bool; |
32 | |
33 | public function setTransportOptions(MydbOptionsInterface $options, MydbEnvironmentInterface $environment): bool; |
34 | |
35 | public function isTransactionOpen(): bool; |
36 | |
37 | public function setTransactionIsolationLevel(string $level): bool; |
38 | |
39 | public function isConnected(): bool; |
40 | |
41 | public function getMysqli(): ?mysqli; |
42 | |
43 | public function realQuery(string $query): bool; |
44 | |
45 | public function readServerResponse(MydbEnvironmentInterface $environment): ?MydbMysqliResultInterface; |
46 | |
47 | public function beginTransactionReadwrite(): bool; |
48 | |
49 | public function beginTransactionReadonly(): bool; |
50 | |
51 | public function rollback(): bool; |
52 | |
53 | public function commitAndRelease(): bool; |
54 | |
55 | public function commit(): bool; |
56 | |
57 | public function realConnect( |
58 | string $host, |
59 | string $username, |
60 | string $password, |
61 | string $dbname, |
62 | ?int $port, |
63 | ?string $socket, |
64 | int $flags, |
65 | ): bool; |
66 | |
67 | public function mysqliReport(int $level): bool; |
68 | |
69 | public function close(): bool; |
70 | |
71 | public function getConnectErrno(): ?int; |
72 | |
73 | public function getConnectError(): ?string; |
74 | |
75 | public function isServerGone(): bool; |
76 | |
77 | public function getError(): ?string; |
78 | |
79 | public function getErrNo(): ?int; |
80 | |
81 | public function getAffectedRows(): ?int; |
82 | |
83 | /** |
84 | * @phpcs:disable SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint |
85 | */ |
86 | public function getInsertId(): int|string|null; |
87 | |
88 | public function autocommit(bool $enable): bool; |
89 | |
90 | /** |
91 | * @param array<int, string> $events |
92 | * @phpcs:disable SlevomatCodingStandard.PHP.DisallowReference.DisallowedPassingByReference |
93 | */ |
94 | public function extractServerResponse(MydbEnvironmentInterface $environment, array &$events): ?mysqli_result; |
95 | |
96 | public function getWarnings(): array; |
97 | } |