Skip to content

Commit ad4a262

Browse files
authored
Optimized phpdoc & code (#6976)
1 parent 2b82a38 commit ad4a262

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/ManagesTransactions.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public function transactionLevel(): int
8484

8585
/**
8686
* Create a transaction within the database.
87+
*
88+
* @throws Throwable
8789
*/
8890
protected function createTransaction(): void
8991
{
@@ -101,7 +103,7 @@ protected function createTransaction(): void
101103
/**
102104
* Create a save point within the database.
103105
*/
104-
protected function createSavepoint()
106+
protected function createSavepoint(): void
105107
{
106108
$this->exec(
107109
$this->compileSavepoint('trans' . ($this->transactions + 1))
@@ -113,7 +115,7 @@ protected function createSavepoint()
113115
*
114116
* @throws Throwable
115117
*/
116-
protected function handleBeginTransactionException(Throwable $e)
118+
protected function handleBeginTransactionException(Throwable $e): void
117119
{
118120
if ($this->causedByLostConnection($e)) {
119121
$this->reconnect();
@@ -127,7 +129,7 @@ protected function handleBeginTransactionException(Throwable $e)
127129
/**
128130
* Perform a rollback within the database.
129131
*/
130-
protected function performRollBack(int $toLevel)
132+
protected function performRollBack(int $toLevel): void
131133
{
132134
if ($toLevel == 0) {
133135
$this->call('rollBack');

src/MySQLConnection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function buildDsn(array $config): string
207207
/**
208208
* Configure the connection character set and collation.
209209
*/
210-
protected function configureCharset(PDO $connection, array $config)
210+
protected function configureCharset(PDO $connection, array $config): void
211211
{
212212
if (isset($config['charset'])) {
213213
$connection->prepare(sprintf("set names '%s'%s", $config['charset'], $this->getCollation($config)))->execute();

0 commit comments

Comments
 (0)