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 2eeb18b
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
{
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)
{
return $this->doFetchAll($mode, ...$args);
}
Expand Down

0 comments on commit 2eeb18b

Please sign in to comment.