You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running FoF with PHP 8.0 or 8.1 shows a lot of Deprecation warnings and one Fatal Error in the PDO Log class. It inherits the PDO class but the function signatures and return types don't match.
The fatal error can be avoided by changing the query function signature to this.
public function query($query, $fetchMode = null, ...$fetchModeArgs)
But before I march ahead I wanted to discuss if I should just "bend" the code to make the warnings go away or if you have better ideas for a refactoring.
Fatal error: Declaration of PDOLog::query($query) must be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false in /fof/classes/pdolog.php on line 20
Deprecated: Return type of PDOLog::exec($statement) should either be compatible with PDO::exec(string $statement): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /fof/classes/pdolog.php on line 31
Deprecated: Return type of PDOLog::query($query, ?int $fetchMode = null, mixed ...$fetchModeArgs) should either be compatible with PDO::query(string $query, ?int $fetchMode = null, mixed ...$fetchModeArgs): PDOStatement|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /fof/classes/pdolog.php on line 20
Deprecated: Return type of PDOStatementLog::bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null) should either be compatible with PDOStatement::bindParam(string|int $param, mixed &$var, int $type = PDO::PARAM_STR, int $maxLength = 0, mixed $driverOptions = null): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /fof/classes/pdolog.php on line 51
Deprecated: Return type of PDOStatementLog::bindValue($parameter, $value, $data_type = PDO::PARAM_STR) should either be compatible with PDOStatement::bindValue(string|int $param, mixed $value, int $type = PDO::PARAM_STR): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /fof/classes/pdolog.php on line 56
Deprecated: Return type of PDOStatementLog::execute($input_parameters = null) should either be compatible with PDOStatement::execute(?array $params = null): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /fof/classes/pdolog.php on line 61
The text was updated successfully, but these errors were encountered:
So far my approach with FOF has been to just fix compatibility issues when I use it with newer PHP versions. If it works, it's fine with me. The code won't win awards for elegance, and neither does it have to ;)
Running FoF with PHP 8.0 or 8.1 shows a lot of Deprecation warnings and one Fatal Error in the PDO Log class. It inherits the PDO class but the function signatures and return types don't match.
The fatal error can be avoided by changing the query function signature to this.
public function query($query, $fetchMode = null, ...$fetchModeArgs)
But before I march ahead I wanted to discuss if I should just "bend" the code to make the warnings go away or if you have better ideas for a refactoring.
The text was updated successfully, but these errors were encountered: