Skip to content

Commit

Permalink
PHP 8.4: Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
michabbb authored and amotl committed Feb 12, 2025
1 parent 1cade25 commit eb30e97
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Crate/PDO/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class InvalidArgumentException extends PDOException implements ExceptionInterface
{
public function __construct($message = 'Invalid argument', $code = 0, Exception $previous = null)
public function __construct($message = 'Invalid argument', $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Crate/PDO/Exception/UnsupportedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class UnsupportedException extends PDOException
{
public function __construct($message = 'Unsupported functionality', $code = 0, Exception $previous = null)
public function __construct($message = 'Unsupported functionality', $code = 0, ?Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Crate/PDO/Http/ServerPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ final class ServerPool implements ServerInterface
* @param array $servers
* @param ClientInterface|null $client
*/
public function __construct(array $servers, ClientInterface $client = null)
public function __construct(array $servers, ?ClientInterface $client = null)
{
if (\count($servers) === 0) {
$servers = [self::DEFAULT_SERVER];
Expand Down
5 changes: 3 additions & 2 deletions src/Crate/PDO/PDOStatementImplementationPhp8.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ trait PDOStatementImplementationPhp8
*
* @return bool
*/
public function setFetchMode(int $mode, ...$args)
#[\ReturnTypeWillChange]
public function setFetchMode(int $mode, ...$args): bool

Check warning on line 41 in src/Crate/PDO/PDOStatementImplementationPhp8.php

View check run for this annotation

Codecov / codecov/patch

src/Crate/PDO/PDOStatementImplementationPhp8.php#L41

Added line #L41 was not covered by tests
{
return $this->doSetFetchMode($mode, ...$args);
}
Expand All @@ -51,7 +52,7 @@ public function setFetchMode(int $mode, ...$args)
* @return mixed[]
*/
#[\ReturnTypeWillChange]
public function fetchAll(int $mode = null, ...$args)
public function fetchAll(?int $mode = null, ...$args)

Check warning on line 55 in src/Crate/PDO/PDOStatementImplementationPhp8.php

View check run for this annotation

Codecov / codecov/patch

src/Crate/PDO/PDOStatementImplementationPhp8.php#L55

Added line #L55 was not covered by tests
{
return $this->doFetchAll($mode, ...$args);
}
Expand Down

0 comments on commit eb30e97

Please sign in to comment.