Skip to content

Commit f6f1dd1

Browse files
peter17Jean85
authored andcommitted
Fix PHP 8 deprecations.
1 parent 63b8755 commit f6f1dd1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ConnectionTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function setGoneAwayDetector(GoneAwayDetector $goneAwayDetector): void
8686
*
8787
* @return R
8888
*/
89-
private function doWithRetry(callable $callable, string $sql = null)
89+
private function doWithRetry(callable $callable, ?string $sql = null)
9090
{
9191
try {
9292
attempt:
@@ -187,7 +187,7 @@ public function beginTransaction(): void
187187
$this->currentlyOpeningFirstLevelTransaction = false;
188188
}
189189

190-
public function canTryAgain(\Throwable $throwable, string $sql = null): bool
190+
public function canTryAgain(\Throwable $throwable, ?string $sql = null): bool
191191
{
192192
if ($this->hasBeenClosedWithAnOpenTransaction && ! $this->currentlyOpeningFirstLevelTransaction) {
193193
return false;

src/Detector/GoneAwayDetector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
interface GoneAwayDetector
66
{
7-
public function isGoneAwayException(\Throwable $exception, string $sql = null): bool;
7+
public function isGoneAwayException(\Throwable $exception, ?string $sql = null): bool;
88
}

src/Detector/MySQLGoneAwayDetector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MySQLGoneAwayDetector implements GoneAwayDetector
1717
'Error while sending QUERY packet',
1818
];
1919

20-
public function isGoneAwayException(\Throwable $exception, string $sql = null): bool
20+
public function isGoneAwayException(\Throwable $exception, ?string $sql = null): bool
2121
{
2222
if ($this->isSavepoint($sql)) {
2323
return false;

0 commit comments

Comments
 (0)